diff inttypes.h @ 18:eb2525abe43a

Better C99 conformance: macros for format specifiers should only be included in C++ implementations if __STDC_FORMAT_MACROS is defined before <inttypes.h> is included.
author ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
date Tue, 09 Oct 2007 12:54:27 +0000
parents f831bbea3401
children fce0b7d5cef7
line wrap: on
line diff
--- a/inttypes.h
+++ b/inttypes.h
@@ -51,6 +51,8 @@ typedef struct {
 
 // 7.8.1 Macros for format specifiers
 
+#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [   See footnote 185 at page 198
+
 // The fprintf macros for signed integers are:
 #define PRId8       "d"
 #define PRIi8       "i"
@@ -259,6 +261,8 @@ typedef struct {
 #  define SCNXPTR     "lX"
 #endif  // _WIN64 ]
 
+#endif // __STDC_FORMAT_MACROS ]
+
 // 7.8.2 Functions for greatest-width integer types
 
 // 7.8.2.1 The imaxabs function