again: sizeof(wchar_t)

Artem B. Bityuckiy abityuckiy@yandex.ru
Mon Apr 26 18:25:00 GMT 2004


Eljay Love-Jensen wrote:
> Hi Artem,
> 
> Use:
> #if WCHAR_BITSIZE == 16
> blah blah blah
> #elif WCHAR_BITSIZE == 32
> blah blah blah
> #else
> #error Unsupported/unknown wchar_t bitsize.
> #endif
> 
> When you are compiling your code with 32-bit wchar_t:
> g++ -DWCHAR_BITSIZE=32 foo.cpp
> 
> When you are compiling your code with 16-bit wchar_t:
> g++ -DWCHAR_BITSIZE=16 foo.cpp

The specific is that I'm upgrading Newlib itself. I'm adding locale and 
some C99 features support to it (Newlib isn't fully C99 complient). This 
is bad way to use such hack. This is like MAX_INT macro. Do you imagine, 
for example, glibc requires you to compile it with make 
CFLAGS+=-DMAX_INT=32? (this is just analogy) :-)
I hope there is some other way exists...

Thanks.


-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.



More information about the Gcc-help mailing list