__WCHAR_TYPE__ and friends (was Re: OpenBSD tester...)

Bruce Korb bkorb@veritas.com
Sat Jul 12 18:19:00 GMT 2003


Nathanael Nerode wrote:
> 
> Bruce Korb wrote:
> >>Partly because I'm not sure exactly what the gnu_types fix *does*. :-)
> >>Bruce, any help?
> >
> >
> > glibc pulls specific types out of particular header files.
>    ^^^^^
> So is this fix at all relevant to the BSDs?  Or do you mean GCC?

Relevant to all platforms using glibc.  :-)
Theoretically, you could substitute glibc for libc on Solaris.
I wouldn't.

> > To accomplish this once and only once during a compile,
> > a bunch of #include wizardry is used to protect specific
> > definitions.  e.g. replace:
> >
> >>typedef int wchar_t;
> >
> > with:
> >
> >>#if !defined(_GCC_WCHAR_T) && ! defined(__cplusplus)
> >>#define _GCC_WCHAR_T
> >>typedef __WCHAR_TYPE__ wchar_t;
> >>#endif
> 
> Does this *work*?  Where is __WCHAR_TYPE__ defined, and how do we
> guarantee that it's defined when this is hit in the include file?  Is it
> predefined by the compiler?  How does the compiler get it 'right'?  How
> do we test that it's gotten it right on OpenBSD?
> 
> OK, so I guess I'm still a bit confused. :-)

Going by recollection, __WCHAR_TYPE__ is internal to gcc.



More information about the Gcc mailing list