1085 #define UINT64_FORMAT_W(width) "%" #width FORMAT64_MODIFIER "u" |
1085 #define UINT64_FORMAT_W(width) "%" #width FORMAT64_MODIFIER "u" |
1086 |
1086 |
1087 // Format macros that allow the field width to be specified. The width must be |
1087 // Format macros that allow the field width to be specified. The width must be |
1088 // a string literal (e.g., "8") or a macro that evaluates to one. |
1088 // a string literal (e.g., "8") or a macro that evaluates to one. |
1089 #ifdef _LP64 |
1089 #ifdef _LP64 |
|
1090 #define UINTX_FORMAT_W(width) UINT64_FORMAT_W(width) |
1090 #define SSIZE_FORMAT_W(width) INT64_FORMAT_W(width) |
1091 #define SSIZE_FORMAT_W(width) INT64_FORMAT_W(width) |
1091 #define SIZE_FORMAT_W(width) UINT64_FORMAT_W(width) |
1092 #define SIZE_FORMAT_W(width) UINT64_FORMAT_W(width) |
1092 #else |
1093 #else |
|
1094 #define UINTX_FORMAT_W(width) UINT32_FORMAT_W(width) |
1093 #define SSIZE_FORMAT_W(width) INT32_FORMAT_W(width) |
1095 #define SSIZE_FORMAT_W(width) INT32_FORMAT_W(width) |
1094 #define SIZE_FORMAT_W(width) UINT32_FORMAT_W(width) |
1096 #define SIZE_FORMAT_W(width) UINT32_FORMAT_W(width) |
1095 #endif // _LP64 |
1097 #endif // _LP64 |
1096 |
1098 |
1097 // Format pointers and size_t (or size_t-like integer types) which change size |
1099 // Format pointers and size_t (or size_t-like integer types) which change size |
1098 // between 32- and 64-bit. |
1100 // between 32- and 64-bit. The pointer format theoretically should be "%p", |
|
1101 // however, it has different output on different platforms. On Windows, the data |
|
1102 // will be padded with zeros automatically. On Solaris, we can use "%016p" & |
|
1103 // "%08p" on 64 bit & 32 bit platforms to make the data padded with extra zeros. |
|
1104 // On Linux, "%016p" or "%08p" is not be allowed, at least on the latest GCC |
|
1105 // 4.3.2. So we have to use "%016x" or "%08x" to simulate the printing format. |
|
1106 // GCC 4.3.2, however requires the data to be converted to "intptr_t" when |
|
1107 // using "%x". |
1099 #ifdef _LP64 |
1108 #ifdef _LP64 |
1100 #define PTR_FORMAT PTR64_FORMAT |
1109 #define PTR_FORMAT PTR64_FORMAT |
1101 #define UINTX_FORMAT UINT64_FORMAT |
1110 #define UINTX_FORMAT UINT64_FORMAT |
1102 #define INTX_FORMAT INT64_FORMAT |
1111 #define INTX_FORMAT INT64_FORMAT |
1103 #define SIZE_FORMAT UINT64_FORMAT |
1112 #define SIZE_FORMAT UINT64_FORMAT |