Sorry for inaccuracy. I meant 'preprocessing time'.What do you mean by 'compile time'? sizeof(wchar_t) is compile time constant, but it isn't availibe for preprocessor conditionals.
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.
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.
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.