2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
6 /* 7.8 Format conversion of integer types <inttypes.h> */
13 #define __need_wchar_t
25 #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
27 /* 7.8.1 Macros for format specifiers
29 * MS runtime does not yet understand C9x standard "ll"
30 * length specifier. It appears to treat "ll" as "l".
31 * The non-standard I64 length specifier causes warning in GCC,
32 * but understood by MS runtime functions.
35 /* fprintf macros for signed types */
41 #define PRIdLEAST8 "d"
42 #define PRIdLEAST16 "d"
43 #define PRIdLEAST32 "d"
44 #define PRIdLEAST64 "I64d"
47 #define PRIdFAST16 "d"
48 #define PRIdFAST32 "d"
49 #define PRIdFAST64 "I64d"
51 #define PRIdMAX "I64d"
58 #define PRIiLEAST8 "i"
59 #define PRIiLEAST16 "i"
60 #define PRIiLEAST32 "i"
61 #define PRIiLEAST64 "I64i"
64 #define PRIiFAST16 "i"
65 #define PRIiFAST32 "i"
66 #define PRIiFAST64 "I64i"
68 #define PRIiMAX "I64i"
75 #define PRIoLEAST8 "o"
76 #define PRIoLEAST16 "o"
77 #define PRIoLEAST32 "o"
78 #define PRIoLEAST64 "I64o"
81 #define PRIoFAST16 "o"
82 #define PRIoFAST32 "o"
83 #define PRIoFAST64 "I64o"
85 #define PRIoMAX "I64o"
87 /* fprintf macros for unsigned types */
94 #define PRIuLEAST8 "u"
95 #define PRIuLEAST16 "u"
96 #define PRIuLEAST32 "u"
97 #define PRIuLEAST64 "I64u"
100 #define PRIuFAST16 "u"
101 #define PRIuFAST32 "u"
102 #define PRIuFAST64 "I64u"
104 #define PRIuMAX "I64u"
109 #define PRIx64 "I64x"
111 #define PRIxLEAST8 "x"
112 #define PRIxLEAST16 "x"
113 #define PRIxLEAST32 "x"
114 #define PRIxLEAST64 "I64x"
116 #define PRIxFAST8 "x"
117 #define PRIxFAST16 "x"
118 #define PRIxFAST32 "x"
119 #define PRIxFAST64 "I64x"
121 #define PRIxMAX "I64x"
126 #define PRIX64 "I64X"
128 #define PRIXLEAST8 "X"
129 #define PRIXLEAST16 "X"
130 #define PRIXLEAST32 "X"
131 #define PRIXLEAST64 "I64X"
133 #define PRIXFAST8 "X"
134 #define PRIXFAST16 "X"
135 #define PRIXFAST32 "X"
136 #define PRIXFAST64 "I64X"
138 #define PRIXMAX "I64X"
141 * fscanf macros for signed int types
142 * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t
143 * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have
144 * no length identifiers
149 #define SCNd64 "I64d"
151 #define SCNdLEAST16 "hd"
152 #define SCNdLEAST32 "d"
153 #define SCNdLEAST64 "I64d"
155 #define SCNdFAST16 "hd"
156 #define SCNdFAST32 "d"
157 #define SCNdFAST64 "I64d"
159 #define SCNdMAX "I64d"
163 #define SCNi64 "I64i"
165 #define SCNiLEAST16 "hi"
166 #define SCNiLEAST32 "i"
167 #define SCNiLEAST64 "I64i"
169 #define SCNiFAST16 "hi"
170 #define SCNiFAST32 "i"
171 #define SCNiFAST64 "I64i"
173 #define SCNiMAX "I64i"
177 #define SCNo64 "I64o"
179 #define SCNoLEAST16 "ho"
180 #define SCNoLEAST32 "o"
181 #define SCNoLEAST64 "I64o"
183 #define SCNoFAST16 "ho"
184 #define SCNoFAST32 "o"
185 #define SCNoFAST64 "I64o"
187 #define SCNoMAX "I64o"
191 #define SCNx64 "I64x"
193 #define SCNxLEAST16 "hx"
194 #define SCNxLEAST32 "x"
195 #define SCNxLEAST64 "I64x"
197 #define SCNxFAST16 "hx"
198 #define SCNxFAST32 "x"
199 #define SCNxFAST64 "I64x"
201 #define SCNxMAX "I64x"
203 /* fscanf macros for unsigned int types */
207 #define SCNu64 "I64u"
209 #define SCNuLEAST16 "hu"
210 #define SCNuLEAST32 "u"
211 #define SCNuLEAST64 "I64u"
213 #define SCNuFAST16 "hu"
214 #define SCNuFAST32 "u"
215 #define SCNuFAST64 "I64u"
217 #define SCNuMAX "I64u"
220 #define PRIdPTR "I64d"
221 #define PRIiPTR "I64i"
222 #define PRIoPTR "I64o"
223 #define PRIuPTR "I64u"
224 #define PRIxPTR "I64x"
225 #define PRIXPTR "I64X"
226 #define SCNdPTR "I64d"
227 #define SCNiPTR "I64i"
228 #define SCNoPTR "I64o"
229 #define SCNxPTR "I64x"
230 #define SCNuPTR "I64u"
245 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
247 * no length modifier for char types prior to C9x
248 * MS runtime scanf appears to treat "hh" as "h"
253 #define SCNdLEAST8 "hhd"
254 #define SCNdFAST8 "hhd"
257 #define SCNiLEAST8 "hhi"
258 #define SCNiFAST8 "hhi"
261 #define SCNoLEAST8 "hho"
262 #define SCNoFAST8 "hho"
265 #define SCNxLEAST8 "hhx"
266 #define SCNxFAST8 "hhx"
270 #define SCNuLEAST8 "hhu"
271 #define SCNuFAST8 "hhu"
272 #endif /* __STDC_VERSION__ >= 199901 */
274 #endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
276 intmax_t __cdecl
imaxabs (intmax_t j
);
277 __CRT_INLINE
intmax_t __cdecl
imaxabs (intmax_t j
)
278 {return (j
>= 0 ? j
: -j
);}
279 imaxdiv_t __cdecl
imaxdiv (intmax_t numer
, intmax_t denom
);
281 /* 7.8.2 Conversion functions for greatest-width integer types */
283 intmax_t __cdecl
strtoimax (const char* __restrict__ nptr
,
284 char** __restrict__ endptr
, int base
);
285 uintmax_t __cdecl
strtoumax (const char* __restrict__ nptr
,
286 char** __restrict__ endptr
, int base
);
288 intmax_t __cdecl
wcstoimax (const wchar_t* __restrict__ nptr
,
289 wchar_t** __restrict__ endptr
, int base
);
290 uintmax_t __cdecl
wcstoumax (const wchar_t* __restrict__ nptr
,
291 wchar_t** __restrict__ endptr
, int base
);
297 #endif /* ndef _INTTYPES_H */