1 /* 7.8 Format conversion of integer types <inttypes.h> */
18 #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
20 /* 7.8.1 Macros for format specifiers
22 * MS runtime does not yet understand C9x standard "ll"
23 * length specifier. It appears to treat "ll" as "l".
24 * The non-standard I64 length specifier causes warning in GCC,
25 * but understood by MS runtime functions.
28 /* fprintf macros for signed types */
34 #define PRIdLEAST8 "d"
35 #define PRIdLEAST16 "d"
36 #define PRIdLEAST32 "d"
37 #define PRIdLEAST64 "I64d"
40 #define PRIdFAST16 "d"
41 #define PRIdFAST32 "d"
42 #define PRIdFAST64 "I64d"
44 #define PRIdMAX "I64d"
52 #define PRIiLEAST8 "i"
53 #define PRIiLEAST16 "i"
54 #define PRIiLEAST32 "i"
55 #define PRIiLEAST64 "I64i"
58 #define PRIiFAST16 "i"
59 #define PRIiFAST32 "i"
60 #define PRIiFAST64 "I64i"
62 #define PRIiMAX "I64i"
70 #define PRIoLEAST8 "o"
71 #define PRIoLEAST16 "o"
72 #define PRIoLEAST32 "o"
73 #define PRIoLEAST64 "I64o"
76 #define PRIoFAST16 "o"
77 #define PRIoFAST32 "o"
78 #define PRIoFAST64 "I64o"
80 #define PRIoMAX "I64o"
84 /* fprintf macros for unsigned types */
91 #define PRIuLEAST8 "u"
92 #define PRIuLEAST16 "u"
93 #define PRIuLEAST32 "u"
94 #define PRIuLEAST64 "I64u"
97 #define PRIuFAST16 "u"
98 #define PRIuFAST32 "u"
99 #define PRIuFAST64 "I64u"
101 #define PRIuMAX "I64u"
107 #define PRIx64 "I64x"
109 #define PRIxLEAST8 "x"
110 #define PRIxLEAST16 "x"
111 #define PRIxLEAST32 "x"
112 #define PRIxLEAST64 "I64x"
114 #define PRIxFAST8 "x"
115 #define PRIxFAST16 "x"
116 #define PRIxFAST32 "x"
117 #define PRIxFAST64 "I64x"
119 #define PRIxMAX "I64x"
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"
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"
164 #define SCNi64 "I64i"
166 #define SCNiLEAST16 "hi"
167 #define SCNiLEAST32 "i"
168 #define SCNiLEAST64 "I64i"
170 #define SCNiFAST16 "hi"
171 #define SCNiFAST32 "i"
172 #define SCNiFAST64 "I64i"
174 #define SCNiMAX "I64i"
179 #define SCNo64 "I64o"
181 #define SCNoLEAST16 "ho"
182 #define SCNoLEAST32 "o"
183 #define SCNoLEAST64 "I64o"
185 #define SCNoFAST16 "ho"
186 #define SCNoFAST32 "o"
187 #define SCNoFAST64 "I64o"
189 #define SCNoMAX "I64o"
194 #define SCNx64 "I64x"
196 #define SCNxLEAST16 "hx"
197 #define SCNxLEAST32 "x"
198 #define SCNxLEAST64 "I64x"
200 #define SCNxFAST16 "hx"
201 #define SCNxFAST32 "x"
202 #define SCNxFAST64 "I64x"
204 #define SCNxMAX "I64x"
208 /* fscanf macros for unsigned int types */
212 #define SCNu64 "I64u"
214 #define SCNuLEAST16 "hu"
215 #define SCNuLEAST32 "u"
216 #define SCNuLEAST64 "I64u"
218 #define SCNuFAST16 "hu"
219 #define SCNuFAST32 "u"
220 #define SCNuFAST64 "I64u"
222 #define SCNuMAX "I64u"
226 /* Defined by the user, or implicitly in <_mingw.h>, indicating that
227 * we are compiling for C99, C++11, or POSIX.1-2001 (or later); no char
228 * type length modifiers are supported prior to C99. Further note that
229 * Microsoft's scanf() appears to treat the ISO-C99/POSIX.1 "hh" length
230 * modifier as if it were just "h".
235 #define SCNdLEAST8 "hhd"
236 #define SCNdFAST8 "hhd"
239 #define SCNiLEAST8 "hhi"
240 #define SCNiFAST8 "hhi"
243 #define SCNoLEAST8 "hho"
244 #define SCNoFAST8 "hho"
247 #define SCNxLEAST8 "hhx"
248 #define SCNxFAST8 "hhx"
252 #define SCNuLEAST8 "hhu"
253 #define SCNuFAST8 "hhu"
254 #endif /* _ISOC99_SOURCE */
256 #endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
258 intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t j);
259 #ifndef __NO_INLINE__
260 __CRT_INLINE __LIBIMPL__(( FUNCTION = imaxabs ))
261 intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t __j)
262 { return __j >= 0 ? __j : -__j; }
264 /* Since intmax_t is effectively analogous to long long, the preceding
265 * implementation will serve admirably as the external representation of
266 * both imaxabs() and llabs(); declare so here, by providing a prototype
267 * only, with the corresponding inline implementation in stdlib.h
269 __CRT_INLINE __LIBIMPL__(( ALIAS = imaxabs ))
270 long long llabs (long long);
273 imaxdiv_t __cdecl __MINGW_NOTHROW imaxdiv (intmax_t numer, intmax_t denom);
275 /* 7.8.2 Conversion functions for greatest-width integer types */
277 intmax_t __cdecl __MINGW_NOTHROW strtoimax (const char* __restrict__ nptr,
278 char** __restrict__ endptr, int base);
279 uintmax_t __cdecl __MINGW_NOTHROW strtoumax (const char* __restrict__ nptr,
280 char** __restrict__ endptr, int base);
282 intmax_t __cdecl __MINGW_NOTHROW wcstoimax (const wchar_t* __restrict__ nptr,
283 wchar_t** __restrict__ endptr, int base);
284 uintmax_t __cdecl __MINGW_NOTHROW wcstoumax (const wchar_t* __restrict__ nptr,
285 wchar_t** __restrict__ endptr, int base);
289 #endif /* ndef _INTTYPES_H */