Futher changes to casts
[tinycc/daniel.git] / win32 / include / inttypes.h
blob74944f14bdbb923b61edbeb5ca14713007510e5a
1 /* 7.8 Format conversion of integer types <inttypes.h> */
3 #ifndef _INTTYPES_H
4 #define _INTTYPES_H
6 #include <stdint.h>
7 #define __need_wchar_t
8 #include <stddef.h>
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
14 typedef struct {
15 intmax_t quot;
16 intmax_t rem;
17 } imaxdiv_t;
19 #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
21 /* 7.8.1 Macros for format specifiers
23 * MS runtime does not yet understand C9x standard "ll"
24 * length specifier. It appears to treat "ll" as "l".
25 * The non-standard I64 length specifier causes warning in GCC,
26 * but understood by MS runtime functions.
29 /* fprintf macros for signed types */
30 #define PRId8 "d"
31 #define PRId16 "d"
32 #define PRId32 "d"
33 #define PRId64 "I64d"
35 #define PRIdLEAST8 "d"
36 #define PRIdLEAST16 "d"
37 #define PRIdLEAST32 "d"
38 #define PRIdLEAST64 "I64d"
40 #define PRIdFAST8 "d"
41 #define PRIdFAST16 "d"
42 #define PRIdFAST32 "d"
43 #define PRIdFAST64 "I64d"
45 #define PRIdMAX "I64d"
46 #define PRIdPTR "d"
48 #define PRIi8 "i"
49 #define PRIi16 "i"
50 #define PRIi32 "i"
51 #define PRIi64 "I64i"
53 #define PRIiLEAST8 "i"
54 #define PRIiLEAST16 "i"
55 #define PRIiLEAST32 "i"
56 #define PRIiLEAST64 "I64i"
58 #define PRIiFAST8 "i"
59 #define PRIiFAST16 "i"
60 #define PRIiFAST32 "i"
61 #define PRIiFAST64 "I64i"
63 #define PRIiMAX "I64i"
64 #define PRIiPTR "i"
66 #define PRIo8 "o"
67 #define PRIo16 "o"
68 #define PRIo32 "o"
69 #define PRIo64 "I64o"
71 #define PRIoLEAST8 "o"
72 #define PRIoLEAST16 "o"
73 #define PRIoLEAST32 "o"
74 #define PRIoLEAST64 "I64o"
76 #define PRIoFAST8 "o"
77 #define PRIoFAST16 "o"
78 #define PRIoFAST32 "o"
79 #define PRIoFAST64 "I64o"
81 #define PRIoMAX "I64o"
83 #define PRIoPTR "o"
85 /* fprintf macros for unsigned types */
86 #define PRIu8 "u"
87 #define PRIu16 "u"
88 #define PRIu32 "u"
89 #define PRIu64 "I64u"
92 #define PRIuLEAST8 "u"
93 #define PRIuLEAST16 "u"
94 #define PRIuLEAST32 "u"
95 #define PRIuLEAST64 "I64u"
97 #define PRIuFAST8 "u"
98 #define PRIuFAST16 "u"
99 #define PRIuFAST32 "u"
100 #define PRIuFAST64 "I64u"
102 #define PRIuMAX "I64u"
103 #define PRIuPTR "u"
105 #define PRIx8 "x"
106 #define PRIx16 "x"
107 #define PRIx32 "x"
108 #define PRIx64 "I64x"
110 #define PRIxLEAST8 "x"
111 #define PRIxLEAST16 "x"
112 #define PRIxLEAST32 "x"
113 #define PRIxLEAST64 "I64x"
115 #define PRIxFAST8 "x"
116 #define PRIxFAST16 "x"
117 #define PRIxFAST32 "x"
118 #define PRIxFAST64 "I64x"
120 #define PRIxMAX "I64x"
121 #define PRIxPTR "x"
123 #define PRIX8 "X"
124 #define PRIX16 "X"
125 #define PRIX32 "X"
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"
139 #define PRIXPTR "X"
142 * fscanf macros for signed int types
143 * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t
144 * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have
145 * no length identifiers
148 #define SCNd16 "hd"
149 #define SCNd32 "d"
150 #define SCNd64 "I64d"
152 #define SCNdLEAST16 "hd"
153 #define SCNdLEAST32 "d"
154 #define SCNdLEAST64 "I64d"
156 #define SCNdFAST16 "hd"
157 #define SCNdFAST32 "d"
158 #define SCNdFAST64 "I64d"
160 #define SCNdMAX "I64d"
161 #define SCNdPTR "d"
163 #define SCNi16 "hi"
164 #define SCNi32 "i"
165 #define SCNi64 "I64i"
167 #define SCNiLEAST16 "hi"
168 #define SCNiLEAST32 "i"
169 #define SCNiLEAST64 "I64i"
171 #define SCNiFAST16 "hi"
172 #define SCNiFAST32 "i"
173 #define SCNiFAST64 "I64i"
175 #define SCNiMAX "I64i"
176 #define SCNiPTR "i"
178 #define SCNo16 "ho"
179 #define SCNo32 "o"
180 #define SCNo64 "I64o"
182 #define SCNoLEAST16 "ho"
183 #define SCNoLEAST32 "o"
184 #define SCNoLEAST64 "I64o"
186 #define SCNoFAST16 "ho"
187 #define SCNoFAST32 "o"
188 #define SCNoFAST64 "I64o"
190 #define SCNoMAX "I64o"
191 #define SCNoPTR "o"
193 #define SCNx16 "hx"
194 #define SCNx32 "x"
195 #define SCNx64 "I64x"
197 #define SCNxLEAST16 "hx"
198 #define SCNxLEAST32 "x"
199 #define SCNxLEAST64 "I64x"
201 #define SCNxFAST16 "hx"
202 #define SCNxFAST32 "x"
203 #define SCNxFAST64 "I64x"
205 #define SCNxMAX "I64x"
206 #define SCNxPTR "x"
209 /* fscanf macros for unsigned int types */
211 #define SCNu16 "hu"
212 #define SCNu32 "u"
213 #define SCNu64 "I64u"
215 #define SCNuLEAST16 "hu"
216 #define SCNuLEAST32 "u"
217 #define SCNuLEAST64 "I64u"
219 #define SCNuFAST16 "hu"
220 #define SCNuFAST32 "u"
221 #define SCNuFAST64 "I64u"
223 #define SCNuMAX "I64u"
224 #define SCNuPTR "u"
226 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
228 * no length modifier for char types prior to C9x
229 * MS runtime scanf appears to treat "hh" as "h"
232 /* signed char */
233 #define SCNd8 "hhd"
234 #define SCNdLEAST8 "hhd"
235 #define SCNdFAST8 "hhd"
237 #define SCNi8 "hhi"
238 #define SCNiLEAST8 "hhi"
239 #define SCNiFAST8 "hhi"
241 #define SCNo8 "hho"
242 #define SCNoLEAST8 "hho"
243 #define SCNoFAST8 "hho"
245 #define SCNx8 "hhx"
246 #define SCNxLEAST8 "hhx"
247 #define SCNxFAST8 "hhx"
249 /* unsigned char */
250 #define SCNu8 "hhu"
251 #define SCNuLEAST8 "hhu"
252 #define SCNuFAST8 "hhu"
253 #endif /* __STDC_VERSION__ >= 199901 */
255 #endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
257 extern inline intmax_t imaxabs (intmax_t j)
258 {return (j >= 0 ? j : -j);}
259 imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom);
261 /* 7.8.2 Conversion functions for greatest-width integer types */
263 intmax_t strtoimax (const char* __restrict__ nptr, char** __restrict__ endptr, int base);
264 uintmax_t strtoumax (const char* __restrict__ nptr, char** __restrict__ endptr, int base);
266 intmax_t wcstoimax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr,
267 int base);
268 uintmax_t wcstoumax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr,
269 int base);
271 #ifdef __cplusplus
273 #endif
275 #endif /* ndef _INTTYPES_H */