diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 1993-10-06 17:49:06 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 1993-10-06 17:49:06 +0000 |
commit | 3f259d6dfb2155820ed569dd479c82561800ebf3 (patch) | |
tree | 84f5810200dd716049f3e518f1d0d147f83d5040 /gcc/cexp.y | |
parent | 176c9e6beb33949a252109a2efefbed9045f9c7b (diff) | |
download | gcc-3f259d6dfb2155820ed569dd479c82561800ebf3.zip gcc-3f259d6dfb2155820ed569dd479c82561800ebf3.tar.gz gcc-3f259d6dfb2155820ed569dd479c82561800ebf3.tar.bz2 |
Let tm file define MAX_*_TYPE_SIZE if *_TYPE_SIZE depends upon target_flags
From-SVN: r5640
Diffstat (limited to 'gcc/cexp.y')
-rw-r--r-- | gcc/cexp.y | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -99,6 +99,22 @@ extern int traditional; #define WCHAR_TYPE_SIZE INT_TYPE_SIZE #endif +#ifndef MAX_CHAR_TYPE_SIZE +#define MAX_CHAR_TYPE_SIZE CHAR_TYPE_SIZE +#endif + +#ifndef MAX_INT_TYPE_SIZE +#define MAX_INT_TYPE_SIZE INT_TYPE_SIZE +#endif + +#ifndef MAX_LONG_TYPE_SIZE +#define MAX_LONG_TYPE_SIZE LONG_TYPE_SIZE +#endif + +#ifndef MAX_WCHAR_TYPE_SIZE +#define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE +#endif + /* Yield nonzero if adding two numbers with A's and B's signs can yield a number with SUM's sign, where A, B, and SUM are all C integers. */ #define possible_sum_sign(a, b, sum) ((((a) ^ (b)) | ~ ((a) ^ (sum))) < 0) @@ -533,13 +549,13 @@ yylex () { register int result = 0; register num_chars = 0; - unsigned width = CHAR_TYPE_SIZE; + unsigned width = MAX_CHAR_TYPE_SIZE; int max_chars; char *token_buffer; if (wide_flag) { - width = WCHAR_TYPE_SIZE; + width = MAX_WCHAR_TYPE_SIZE; #ifdef MULTIBYTE_CHARS max_chars = MB_CUR_MAX; #else @@ -547,7 +563,7 @@ yylex () #endif } else - max_chars = LONG_TYPE_SIZE / width; + max_chars = MAX_LONG_TYPE_SIZE / width; token_buffer = (char *) alloca (max_chars + 1); @@ -790,9 +806,9 @@ parse_escape (string_ptr) break; } } - if ((i & ~((1 << CHAR_TYPE_SIZE) - 1)) != 0) + if ((i & ~((1 << MAX_CHAR_TYPE_SIZE) - 1)) != 0) { - i &= (1 << CHAR_TYPE_SIZE) - 1; + i &= (1 << MAX_CHAR_TYPE_SIZE) - 1; warning ("octal character constant does not fit in a byte"); } return i; |