This is the mail archive of the gcc-patches@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: Fix gcc.dg/cpp/ucs.c


Richard Henderson wrote:-

> How about something like this?

[...]
 
> #include <limits.h>
> 
> #define unsigned        +0
> #define int             +0
> #define char            +1
> #define short           +2
> #define long            +3
> 
> #if __WCHAR_TYPE__ == 0
> # define WCHAR_MAX	INT_MAX
> #elif __WCHAR_TYPE__ == 1
> # define WCHAR_MAX	CHAR_MAX
> #elif __WCHAR_TYPE__ == 2
> # define WCHAR_MAX	SHRT_MAX
> #elif __WCHAR_TYPE__ == 3
> # define WCHAR_MAX	LONG_MAX
> #else
> # error wacky wchar_t
> #endif

Heh, now that's the product of a warped mind.  At least, it's
innovative preprocessor abuse 8-)

Looks good to me.

Neil.


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