diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-07 22:21:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-07 22:21:31 +0000 |
commit | 614842802476068c08bced367fa97de4963fd6af (patch) | |
tree | 5cf44b828ff2bacea75033f719370091654bcaa6 /lib/Headers/stdint.h | |
parent | e469fa009a7bdc92df3bc6e78209f2f7404e383e (diff) |
C++ really shouldn't check these #defines, thanks to Howard
for pointing this out!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Headers/stdint.h')
-rw-r--r-- | lib/Headers/stdint.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/Headers/stdint.h b/lib/Headers/stdint.h index ec8810a840..8841ed06e5 100644 --- a/lib/Headers/stdint.h +++ b/lib/Headers/stdint.h @@ -100,10 +100,11 @@ typedef __UINTMAX_TYPE__ uintmax_t; * C99 7.18.2.2 Limits of minimum-width integer types. * Since we map these directly onto fixed-sized types, these values the same. * C99 7.18.2.3 Limits of fastest minimum-width integer types. + * + * Note that C++ should not check __STDC_LIMIT_MACROS here, contrary to the + * claims of the C standard (see C++ 18.3.1p2, [cstdint.syn]). */ -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) - #define INT8_MAX 127 #define INT8_MIN (-128) #define UINT8_MAX 255 @@ -202,12 +203,11 @@ typedef __UINTMAX_TYPE__ uintmax_t; #define WCHAR_MIN (-__WCHAR_MAX__-1) #endif -#endif /* C++ needs __STDC_LIMIT_MACROS. */ - -/* C99 7.18.4 Macros for minimum-width integer constants. */ - -/* C99 Footnote 220: C++ requires __STDC_CONSTANT_MACROS. */ -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) +/* C99 7.18.4 Macros for minimum-width integer constants. + * + * Note that C++ should not check __STDC_CONSTANT_MACROS here, contrary to the + * claims of the C standard (see C++ 18.3.1p2, [cstdint.syn]). + */ #define INT8_C(v) (v) #define UINT8_C(v) (v##U) @@ -226,6 +226,4 @@ typedef __UINTMAX_TYPE__ uintmax_t; #define INTMAX_C(v) (v##LL) #define UINTMAX_C(v) (v##ULL) -#endif /* C++ requires __STDC_CONSTANT_MACROS */ - #endif /* __STDINT_H */ |