diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2002-10-11 02:21:56 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2002-10-11 02:21:56 +0000 |
commit | 798a4740d7088b33fc3a3d60e7a016c8501d0a21 (patch) | |
tree | f7b7694da2490a1930b0a1e624c587f4204c7565 /winsup/mingw | |
parent | f98e630084bfb300d40c184c65c339261e95a68c (diff) | |
download | newlib-798a4740d7088b33fc3a3d60e7a016c8501d0a21.zip newlib-798a4740d7088b33fc3a3d60e7a016c8501d0a21.tar.gz newlib-798a4740d7088b33fc3a3d60e7a016c8501d0a21.tar.bz2 |
* include/stdint.h (INT64_C, UINT64_C ): Append suffix to let
macros work with C89.
(INTMAX_C, UINTMAX_C): Likewise.
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/mingw/include/stdint.h | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index fb8e57e..9808a1f 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,5 +1,11 @@ 2002-10-11 Danny Smith <dannysmith@users.sourceforge.net> + * include/stdint.h (INT64_C, UINT64_C ): Append suffix to let + macros work with C89. + (INTMAX_C, UINTMAX_C): Likewise. + +2002-10-11 Danny Smith <dannysmith@users.sourceforge.net> + * include/string.h (strcasecmp): Make extern __inline__. (strncasecmp): Likewise. (wcscmpi): Likewise. diff --git a/winsup/mingw/include/stdint.h b/winsup/mingw/include/stdint.h index ec1566d..258002e 100644 --- a/winsup/mingw/include/stdint.h +++ b/winsup/mingw/include/stdint.h @@ -170,16 +170,18 @@ typedef unsigned long long uintmax_t; #define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val)) #define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val)) #define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val)) -#define INT64_C(val) (INT_LEAST64_MAX-INT_LEAST64_MAX+(val)) +/* The 'trick' doesn't work in C89 for long long because, without + suffix, (val) will be evaluated as int, not intmax_t */ +#define INT64_C(val) val##LL #define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val)) #define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val)) #define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val)) -#define UINT64_C(val) (UINT_LEAST64_MAX-UINT_LEAST64_MAX+(val)) +#define UINT64_C(val) val##ULL /* 7.18.4.2 Macros for greatest-width integer constants */ -#define INTMAX_C(val) (INTMAX_MAX-INTMAX_MAX+(val)) -#define UINTMAX_C(val) (UINTMAX_MAX-UINTMAX_MAX+(val)) +#define INTMAX_C(val) val##LL +#define UINTMAX_C(val) val##ULL #endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ |