3 * Copyright 2012, 2013 MinGW.org project
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
26 #pragma GCC system_header
29 /* 7.8 Format conversion of integer types <inttypes.h> */
32 #define __need_wchar_t
44 #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
46 /* 7.8.1 Macros for format specifiers
48 * MS runtime does not yet understand C9x standard "ll"
49 * length specifier. It appears to treat "ll" as "l".
50 * The non-standard I64 length specifier causes warning in GCC,
51 * but understood by MS runtime functions.
54 /* fprintf macros for signed types */
60 #define PRIdLEAST8 "d"
61 #define PRIdLEAST16 "d"
62 #define PRIdLEAST32 "d"
63 #define PRIdLEAST64 "I64d"
66 #define PRIdFAST16 "d"
67 #define PRIdFAST32 "d"
68 #define PRIdFAST64 "I64d"
70 #define PRIdMAX "I64d"
77 #define PRIiLEAST8 "i"
78 #define PRIiLEAST16 "i"
79 #define PRIiLEAST32 "i"
80 #define PRIiLEAST64 "I64i"
83 #define PRIiFAST16 "i"
84 #define PRIiFAST32 "i"
85 #define PRIiFAST64 "I64i"
87 #define PRIiMAX "I64i"
94 #define PRIoLEAST8 "o"
95 #define PRIoLEAST16 "o"
96 #define PRIoLEAST32 "o"
97 #define PRIoLEAST64 "I64o"
100 #define PRIoFAST16 "o"
101 #define PRIoFAST32 "o"
102 #define PRIoFAST64 "I64o"
104 #define PRIoMAX "I64o"
106 /* fprintf macros for unsigned types */
110 #define PRIu64 "I64u"
113 #define PRIuLEAST8 "u"
114 #define PRIuLEAST16 "u"
115 #define PRIuLEAST32 "u"
116 #define PRIuLEAST64 "I64u"
118 #define PRIuFAST8 "u"
119 #define PRIuFAST16 "u"
120 #define PRIuFAST32 "u"
121 #define PRIuFAST64 "I64u"
123 #define PRIuMAX "I64u"
128 #define PRIx64 "I64x"
130 #define PRIxLEAST8 "x"
131 #define PRIxLEAST16 "x"
132 #define PRIxLEAST32 "x"
133 #define PRIxLEAST64 "I64x"
135 #define PRIxFAST8 "x"
136 #define PRIxFAST16 "x"
137 #define PRIxFAST32 "x"
138 #define PRIxFAST64 "I64x"
140 #define PRIxMAX "I64x"
145 #define PRIX64 "I64X"
147 #define PRIXLEAST8 "X"
148 #define PRIXLEAST16 "X"
149 #define PRIXLEAST32 "X"
150 #define PRIXLEAST64 "I64X"
152 #define PRIXFAST8 "X"
153 #define PRIXFAST16 "X"
154 #define PRIXFAST32 "X"
155 #define PRIXFAST64 "I64X"
157 #define PRIXMAX "I64X"
160 #define PRIdPTR "I64d"
161 #define PRIiPTR "I64i"
162 #define PRIoPTR "I64o"
163 #define PRIuPTR "I64u"
164 #define PRIxPTR "I64x"
165 #define PRIXPTR "I64X"
176 * fscanf macros for signed int types
177 * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t
178 * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have
179 * no length identifiers
184 #define SCNd64 "I64d"
186 #define SCNdLEAST16 "hd"
187 #define SCNdLEAST32 "d"
188 #define SCNdLEAST64 "I64d"
190 #define SCNdFAST16 "hd"
191 #define SCNdFAST32 "d"
192 #define SCNdFAST64 "I64d"
194 #define SCNdMAX "I64d"
198 #define SCNi64 "I64i"
200 #define SCNiLEAST16 "hi"
201 #define SCNiLEAST32 "i"
202 #define SCNiLEAST64 "I64i"
204 #define SCNiFAST16 "hi"
205 #define SCNiFAST32 "i"
206 #define SCNiFAST64 "I64i"
208 #define SCNiMAX "I64i"
212 #define SCNo64 "I64o"
214 #define SCNoLEAST16 "ho"
215 #define SCNoLEAST32 "o"
216 #define SCNoLEAST64 "I64o"
218 #define SCNoFAST16 "ho"
219 #define SCNoFAST32 "o"
220 #define SCNoFAST64 "I64o"
222 #define SCNoMAX "I64o"
226 #define SCNx64 "I64x"
228 #define SCNxLEAST16 "hx"
229 #define SCNxLEAST32 "x"
230 #define SCNxLEAST64 "I64x"
232 #define SCNxFAST16 "hx"
233 #define SCNxFAST32 "x"
234 #define SCNxFAST64 "I64x"
236 #define SCNxMAX "I64x"
238 /* fscanf macros for unsigned int types */
242 #define SCNu64 "I64u"
244 #define SCNuLEAST16 "hu"
245 #define SCNuLEAST32 "u"
246 #define SCNuLEAST64 "I64u"
248 #define SCNuFAST16 "hu"
249 #define SCNuFAST32 "u"
250 #define SCNuFAST64 "I64u"
252 #define SCNuMAX "I64u"
255 #define SCNdPTR "I64d"
256 #define SCNiPTR "I64i"
257 #define SCNoPTR "I64o"
258 #define SCNxPTR "I64x"
259 #define SCNuPTR "I64u"
268 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
270 * no length modifier for char types prior to C9x
271 * MS runtime scanf appears to treat "hh" as "h"
276 #define SCNdLEAST8 "hhd"
277 #define SCNdFAST8 "hhd"
280 #define SCNiLEAST8 "hhi"
281 #define SCNiFAST8 "hhi"
284 #define SCNoLEAST8 "hho"
285 #define SCNoFAST8 "hho"
288 #define SCNxLEAST8 "hhx"
289 #define SCNxFAST8 "hhx"
293 #define SCNuLEAST8 "hhu"
294 #define SCNuFAST8 "hhu"
295 #endif /* __STDC_VERSION__ >= 199901 */
297 #endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
299 intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t j);
300 #ifndef __NO_INLINE__
301 __CRT_INLINE intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t j)
302 {return (j >= 0 ? j : -j);}
304 imaxdiv_t __cdecl __MINGW_NOTHROW imaxdiv (intmax_t numer, intmax_t denom);
306 /* 7.8.2 Conversion functions for greatest-width integer types */
308 intmax_t __cdecl __MINGW_NOTHROW strtoimax (const char* __restrict__ nptr,
309 char** __restrict__ endptr, int base);
310 uintmax_t __cdecl __MINGW_NOTHROW strtoumax (const char* __restrict__ nptr,
311 char** __restrict__ endptr, int base);
313 intmax_t __cdecl __MINGW_NOTHROW wcstoimax (const wchar_t* __restrict__ nptr,
314 wchar_t** __restrict__ endptr, int base);
315 uintmax_t __cdecl __MINGW_NOTHROW wcstoumax (const wchar_t* __restrict__ nptr,
316 wchar_t** __restrict__ endptr, int base);
322 #endif /* ndef _INTTYPES_H */