This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: size of wchar_t


Eljay Love-Jensen wrote:
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.

I'll think about this, thanks.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]