# HG changeset patch # User ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde # Date 1191934467 0 # Node ID eb2525abe43a75034d401e9eacc983028ce5e1b0 # Parent 5f2b8140b2cdd302630a047bd05d77b22dc32616 Better C99 conformance: macros for format specifiers should only be included in C++ implementations if __STDC_FORMAT_MACROS is defined before is included. diff --git a/inttypes.h b/inttypes.h --- 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