Re: size of wchar_t

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

 



llewelly@xxxxxxxxxxxx wrote:
What do you mean by 'compile time'? sizeof(wchar_t) is compile time
    constant, but it isn't availibe for preprocessor conditionals.
Sorry for inaccuracy. I meant 'preprocessing time'.

I can't find one. However, C99 requires <wchar.h> and <stdint.h> to provide WCHAR_MIN and WCHAR_MAX. You didn't say which C library you were using, but it would be easy to check. They are not quite what you want, but maybe they are close enough.
I use Newlib, which isn't C99-compliant. To be more precise, I'm adding wide IO (C99 feature) to Newlib. I'll add these macros myself if needed.

But in general (as I understand), the size of wchar is defined by *gcc* (there is -fshort-wchar option). Therefore, some predefined *GCCs* macro should exist. All libc's macros (like WCHAR_MIN) should depend on this gcc's macro. But it seems Gnu libc defines WCHAR_MAX to 0xFFFFFFFF verbatim ... :-(
The above macros are C99-specifc. :-( .

Any thoughts?


Thanks for help.
--
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