2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file was original part of the w64 mingw-runtime package.
7 * THIS SOFTWARE IS NOT COPYRIGHTED
9 * Modified for libusb/MSVC: Pete Batard <pbatard@gmail.com>
11 * This source code is offered for use in the public domain. You may
12 * use, modify or distribute it freely.
14 * This code is distributed in the hope that it will be useful but
15 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
16 * DISCLAIMED. This includes but is not limited to warranties of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 #error This header should only be used with Microsoft compilers
26 /* 7.8 Format conversion of integer types <inttypes.h> */
43 /* 7.8.1 Macros for format specifiers
45 * MS runtime does not yet understand C9x standard "ll"
46 * length specifier. It appears to treat "ll" as "l".
47 * The non-standard I64 length specifier causes warning in GCC,
48 * but understood by MS runtime functions.
51 /* fprintf macros for signed types */
57 #define PRIdLEAST8 "d"
58 #define PRIdLEAST16 "d"
59 #define PRIdLEAST32 "d"
60 #define PRIdLEAST64 "I64d"
63 #define PRIdFAST16 "d"
64 #define PRIdFAST32 "d"
65 #define PRIdFAST64 "I64d"
67 #define PRIdMAX "I64d"
74 #define PRIiLEAST8 "i"
75 #define PRIiLEAST16 "i"
76 #define PRIiLEAST32 "i"
77 #define PRIiLEAST64 "I64i"
80 #define PRIiFAST16 "i"
81 #define PRIiFAST32 "i"
82 #define PRIiFAST64 "I64i"
84 #define PRIiMAX "I64i"
91 #define PRIoLEAST8 "o"
92 #define PRIoLEAST16 "o"
93 #define PRIoLEAST32 "o"
94 #define PRIoLEAST64 "I64o"
97 #define PRIoFAST16 "o"
98 #define PRIoFAST32 "o"
99 #define PRIoFAST64 "I64o"
101 #define PRIoMAX "I64o"
103 /* fprintf macros for unsigned types */
107 #define PRIu64 "I64u"
110 #define PRIuLEAST8 "u"
111 #define PRIuLEAST16 "u"
112 #define PRIuLEAST32 "u"
113 #define PRIuLEAST64 "I64u"
115 #define PRIuFAST8 "u"
116 #define PRIuFAST16 "u"
117 #define PRIuFAST32 "u"
118 #define PRIuFAST64 "I64u"
120 #define PRIuMAX "I64u"
125 #define PRIx64 "I64x"
127 #define PRIxLEAST8 "x"
128 #define PRIxLEAST16 "x"
129 #define PRIxLEAST32 "x"
130 #define PRIxLEAST64 "I64x"
132 #define PRIxFAST8 "x"
133 #define PRIxFAST16 "x"
134 #define PRIxFAST32 "x"
135 #define PRIxFAST64 "I64x"
137 #define PRIxMAX "I64x"
142 #define PRIX64 "I64X"
144 #define PRIXLEAST8 "X"
145 #define PRIXLEAST16 "X"
146 #define PRIXLEAST32 "X"
147 #define PRIXLEAST64 "I64X"
149 #define PRIXFAST8 "X"
150 #define PRIXFAST16 "X"
151 #define PRIXFAST32 "X"
152 #define PRIXFAST64 "I64X"
154 #define PRIXMAX "I64X"
157 * fscanf macros for signed int types
158 * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t
159 * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have
160 * no length identifiers
165 #define SCNd64 "I64d"
167 #define SCNdLEAST16 "hd"
168 #define SCNdLEAST32 "d"
169 #define SCNdLEAST64 "I64d"
171 #define SCNdFAST16 "hd"
172 #define SCNdFAST32 "d"
173 #define SCNdFAST64 "I64d"
175 #define SCNdMAX "I64d"
179 #define SCNi64 "I64i"
181 #define SCNiLEAST16 "hi"
182 #define SCNiLEAST32 "i"
183 #define SCNiLEAST64 "I64i"
185 #define SCNiFAST16 "hi"
186 #define SCNiFAST32 "i"
187 #define SCNiFAST64 "I64i"
189 #define SCNiMAX "I64i"
193 #define SCNo64 "I64o"
195 #define SCNoLEAST16 "ho"
196 #define SCNoLEAST32 "o"
197 #define SCNoLEAST64 "I64o"
199 #define SCNoFAST16 "ho"
200 #define SCNoFAST32 "o"
201 #define SCNoFAST64 "I64o"
203 #define SCNoMAX "I64o"
207 #define SCNx64 "I64x"
209 #define SCNxLEAST16 "hx"
210 #define SCNxLEAST32 "x"
211 #define SCNxLEAST64 "I64x"
213 #define SCNxFAST16 "hx"
214 #define SCNxFAST32 "x"
215 #define SCNxFAST64 "I64x"
217 #define SCNxMAX "I64x"
219 /* fscanf macros for unsigned int types */
223 #define SCNu64 "I64u"
225 #define SCNuLEAST16 "hu"
226 #define SCNuLEAST32 "u"
227 #define SCNuLEAST64 "I64u"
229 #define SCNuFAST16 "hu"
230 #define SCNuFAST32 "u"
231 #define SCNuFAST64 "I64u"
233 #define SCNuMAX "I64u"
236 #define PRIdPTR "I64d"
237 #define PRIiPTR "I64i"
238 #define PRIoPTR "I64o"
239 #define PRIuPTR "I64u"
240 #define PRIxPTR "I64x"
241 #define PRIXPTR "I64X"
242 #define SCNdPTR "I64d"
243 #define SCNiPTR "I64i"
244 #define SCNoPTR "I64o"
245 #define SCNxPTR "I64x"
246 #define SCNuPTR "I64u"
261 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
263 * no length modifier for char types prior to C9x
264 * MS runtime scanf appears to treat "hh" as "h"
269 #define SCNdLEAST8 "hhd"
270 #define SCNdFAST8 "hhd"
273 #define SCNiLEAST8 "hhi"
274 #define SCNiFAST8 "hhi"
277 #define SCNoLEAST8 "hho"
278 #define SCNoFAST8 "hho"
281 #define SCNxLEAST8 "hhx"
282 #define SCNxFAST8 "hhx"
286 #define SCNuLEAST8 "hhu"
287 #define SCNuFAST8 "hhu"
288 #endif /* __STDC_VERSION__ >= 199901 */
295 #endif /* ndef _INTTYPES_H */