again: sizeof(wchar_t)

Eljay Love-Jensen eljay@adobe.com
Mon Apr 26 11:45:00 GMT 2004


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

HTH,
--Eljay



More information about the Gcc-help mailing list