This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: again: sizeof(wchar_t)
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: "Artem B. Bityuckiy" <abityuckiy at yandex dot ru>, gcc-help at gcc dot gnu dot org
- Date: Mon, 26 Apr 2004 06:45:20 -0500
- Subject: Re: again: sizeof(wchar_t)
- References: <408A31A3.1030508@yandex.ru>
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