diff options
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r-- | gcc/cpplib.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h index 661bbe5..434e455 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -191,18 +191,18 @@ struct cpp_token /* A type wide enough to hold any multibyte source character. cpplib's character constant interpreter requires an unsigned type. - Also, a typedef for the signed equivalent. */ -#ifndef MAX_WCHAR_TYPE_SIZE -# define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE -#endif -#if CHAR_BIT * SIZEOF_INT >= MAX_WCHAR_TYPE_SIZE + Also, a typedef for the signed equivalent. + The width of this type is capped at 32 bits; there do exist targets + where wchar_t is 64 bits, but only in a non-default mode, and there + would be no meaningful interpretation for a wchar_t value greater + than 2^32 anyway -- the widest wide-character encoding around is + ISO 10646, which stops at 2^31. */ +#if CHAR_BIT * SIZEOF_INT >= 32 # define CPPCHAR_SIGNED_T int +#elif CHAR_BIT * SIZEOF_LONG >= 32 +# define CPPCHAR_SIGNED_T long #else -# if CHAR_BIT * SIZEOF_LONG >= MAX_WCHAR_TYPE_SIZE || !HAVE_LONG_LONG -# define CPPCHAR_SIGNED_T long -# else -# define CPPCHAR_SIGNED_T long long -# endif +# error "Cannot find a least-32-bit signed integer type" #endif typedef unsigned CPPCHAR_SIGNED_T cppchar_t; typedef CPPCHAR_SIGNED_T cppchar_signed_t; |