pinttypes.h (1064B)
1 #ifndef PINTTYPES_H 2 #define PINTTYPES_H 3 4 #ifndef PRId16 5 6 #if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) 7 /* C99 or newer */ 8 #include <inttypes.h> 9 #else 10 11 /* 12 * This is not a complete implementation of <inttypes.h>, just the most 13 * useful printf modifiers. 14 */ 15 16 #include "pstdint.h" 17 18 #ifndef PRINTF_INT64_MODIFIER 19 #error "please define PRINTF_INT64_MODIFIER" 20 #endif 21 22 #ifndef PRId64 23 #define PRId64 PRINTF_INT64_MODIFIER "d" 24 #define PRIu64 PRINTF_INT64_MODIFIER "u" 25 #define PRIx64 PRINTF_INT64_MODIFIER "x" 26 #endif 27 28 #ifndef PRINTF_INT32_MODIFIER 29 #define PRINTF_INT32_MODIFIER "l" 30 #endif 31 32 #ifndef PRId32 33 #define PRId32 PRINTF_INT32_MODIFIER "d" 34 #define PRIu32 PRINTF_INT32_MODIFIER "u" 35 #define PRIx32 PRINTF_INT32_MODIFIER "x" 36 #endif 37 38 #ifndef PRINTF_INT16_MODIFIER 39 #define PRINTF_INT16_MODIFIER "h" 40 #endif 41 42 #ifndef PRId16 43 #define PRId16 PRINTF_INT16_MODIFIER "d" 44 #define PRIu16 PRINTF_INT16_MODIFIER "u" 45 #define PRIx16 PRINTF_INT16_MODIFIER "x" 46 #endif 47 48 # endif /* __STDC__ */ 49 50 #endif /* PRId16 */ 51 52 #endif /* PINTTYPES */