comparison th_types.h @ 672:1d4d22c862ed

Mess with PRI* types again.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 24 Feb 2020 07:42:34 +0200
parents 284d5b789b7c
children 4ca6a3b30fe8
comparison
equal deleted inserted replaced
671:45c2e474a997 672:1d4d22c862ed
96 #endif 96 #endif
97 97
98 98
99 // Define some printf specifiers and other useful things 99 // Define some printf specifiers and other useful things
100 #if TH_ARCH == 32 100 #if TH_ARCH == 32
101 # define PRIu_SIZE_T PRIu32 101 # define PRIu_SIZE_T PRIu32
102 # define PRId_SSIZE_T PRId32 102 # define PRId_SSIZE_T PRId32
103 # define PRIx_SIZE_T PRIx32 103 # define PRIx_SIZE_T PRIx32
104 # define PRIu_OFF_T PRIu32 104 # define PRIX_SIZE_T PRIX32
105 # define PRIx_OFF_T PRId32 105 # ifdef TH_PLAT_WINDOWS
106 # define PRIX_OFF_T PRIx32 106 # define PRId_OFF_T "ld"
107 # define PRIx_OFF_T "lx"
108 # define PRIX_OFF_T "lX"
109 # else
110 # define PRId_OFF_T PRId32
111 # define PRIx_OFF_T PRIx32
112 # define PRIX_OFF_T PRIX32
113 # endif
107 # ifndef TH_PTRSIZE 114 # ifndef TH_PTRSIZE
108 # define TH_PTRSIZE 32 115 # define TH_PTRSIZE 32
109 # endif 116 # endif
110 # ifndef INTPTR_MIN 117 # ifndef INTPTR_MIN
111 # define INTPTR_MIN (-0x7fffffffL - 1) 118 # define INTPTR_MIN (-0x7fffffffL - 1)
112 # define INTPTR_MAX ( 0x7fffffffL) 119 # define INTPTR_MAX ( 0x7fffffffL)
113 # define UINTPTR_MAX ( 0xffffffffUL) 120 # define UINTPTR_MAX ( 0xffffffffUL)
114 # endif 121 # endif
115 #elif TH_ARCH == 64 122 #elif TH_ARCH == 64
116 # define PRIu_SIZE_T PRIu64 123 # ifdef TH_PLAT_WINDOWS // Unsure if this is MinGW64 only thing?
117 # define PRId_SSIZE_T PRId64 124 # define PRIu_SIZE_T "I64u"
118 # define PRIx_SIZE_T PRIx64 125 # define PRId_SSIZE_T "I64d"
119 # define PRIu_OFF_T PRIu64 126 # define PRIx_SIZE_T "I64x"
120 # define PRIx_OFF_T PRId64 127 # define PRIX_SIZE_T "I64X"
121 # define PRIX_OFF_T PRIx64 128 # define PRId_OFF_T "I64d"
129 # define PRIx_OFF_T "I64x"
130 # define PRIX_OFF_T "I64X"
131 # else
132 # define PRIu_SIZE_T PRIu64
133 # define PRId_SSIZE_T PRId64
134 # define PRIx_SIZE_T PRIx64
135 # define PRIX_SIZE_T PRIX64
136 # define PRId_OFF_T PRId64
137 # define PRIx_OFF_T PRIx64
138 # define PRIX_OFF_T PRIX64
139 # endif
122 # ifndef TH_PTRSIZE 140 # ifndef TH_PTRSIZE
123 # define TH_PTRSIZE 64 141 # define TH_PTRSIZE 64
124 # endif 142 # endif
125 # ifndef INTPTR_MIN 143 # ifndef INTPTR_MIN
126 # define INTPTR_MIN (-0x7fffffffffffffffL - 1) 144 # define INTPTR_MIN (-0x7fffffffffffffffL - 1)