Re: again: sizeof(wchar_t)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux