Fix gcc.dg/cpp/ucs.c

Neil Booth neil@daikokuya.demon.co.uk
Wed Mar 27 10:05:00 GMT 2002


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.



More information about the Gcc-patches mailing list