Re: size of wchar_t

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

 



Hi Artem,

I've used this trick in the past:

g++ -c -DWCHAR_BIT_SIZE=32 foo.cpp

On some platforms it is 31 bit (sufficient for ISO 10646); but I use 32 even in that case, thus I'm including the fallow bit. WCHAR_MAX will be 0x7FFFFFFFu on those platforms.

g++ -c -DWCHAR_BIT_SIZE=16 -fshort-wchar foo.cpp

I then use the WCHAR_BIT_SIZE to alter code behavior. Absence of WCHAR_BIT_SIZE causes a #error.

HTH,
--Eljay


[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