[cfe-commits] r64037 - /cfe/trunk/lib/Headers/stdint.h

Chris Lattner sabre at nondot.org
Sat Feb 7 14:21:31 PST 2009


Author: lattner
Date: Sat Feb  7 16:21:31 2009
New Revision: 64037

URL: http://llvm.org/viewvc/llvm-project?rev=64037&view=rev
Log:
C++ really shouldn't check these #defines, thanks to Howard
for pointing this out!


Modified:
    cfe/trunk/lib/Headers/stdint.h

Modified: cfe/trunk/lib/Headers/stdint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stdint.h?rev=64037&r1=64036&r2=64037&view=diff

==============================================================================
--- cfe/trunk/lib/Headers/stdint.h (original)
+++ cfe/trunk/lib/Headers/stdint.h Sat Feb  7 16:21:31 2009
@@ -100,10 +100,11 @@
  * 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 @@
 #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 @@
 #define INTMAX_C(v)  (v##LL)
 #define UINTMAX_C(v) (v##ULL)
 
-#endif  /* C++ requires __STDC_CONSTANT_MACROS */
-
 #endif /* __STDINT_H */





More information about the cfe-commits mailing list