Skip to content

Commit

Permalink
Better C99 conformance: macros for format specifiers should only be i…
Browse files Browse the repository at this point in the history
…ncluded in C++ implementations if __STDC_FORMAT_MACROS is defined before <inttypes.h> is included.
  • Loading branch information
chemeris committed Oct 9, 2007
1 parent 3434329 commit 008aaa4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inttypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 008aaa4

Please sign in to comment.