Update gnulib to current trunk
[binutils-gdb.git] / gnulib / import / inttypes.in.h
blob9f04a6ced4a85f3b16f00e5181903f9e5361a77c
1 /* Copyright (C) 2006-2020 Free Software Foundation, Inc.
2 Written by Paul Eggert, Bruno Haible, Derek Price.
3 This file is part of gnulib.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
19 * ISO C 99 <inttypes.h> for platforms that lack it.
20 * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html>
23 #if __GNUC__ >= 3
24 @PRAGMA_SYSTEM_HEADER@
25 #endif
26 @PRAGMA_COLUMNS@
28 /* Include the original <inttypes.h> if it exists, and if this file
29 has not been included yet or if this file includes gnulib stdint.h
30 which in turn includes this file.
31 The include_next requires a split double-inclusion guard. */
32 #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
33 # if @HAVE_INTTYPES_H@
35 /* Some pre-C++11 <stdint.h> implementations need this. */
36 # if defined __cplusplus && ! defined __STDC_FORMAT_MACROS
37 # define __STDC_FORMAT_MACROS 1
38 # endif
40 # @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
42 # define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H
43 # endif
44 #endif
46 #if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
47 #define INTTYPES_H
49 /* Include <stdint.h> or the gnulib replacement.
50 But avoid namespace pollution on glibc systems. */
51 #ifndef __GLIBC__
52 # include <stdint.h>
53 #endif
54 /* Get CHAR_BIT, INT_MAX, LONG_MAX, etc. */
55 #include <limits.h>
56 /* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
57 #if defined _WIN32 && ! defined __CYGWIN__
58 # include <stdio.h>
59 #endif
61 #if !(INT_MAX == 0x7fffffff && INT_MIN + INT_MAX == -1)
62 # error "This file assumes that 'int' is 32-bit two's complement. Please report your platform and compiler to <bug-gnulib@gnu.org>."
63 #endif
65 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
67 /* The definition of _GL_ARG_NONNULL is copied here. */
69 /* The definition of _GL_WARN_ON_USE is copied here. */
71 /* 7.8.1 Macros for format specifiers */
73 #if defined _TNS_R_TARGET
74 /* Tandem NonStop R series and compatible platforms released before
75 July 2005 support %Ld but not %lld. */
76 # define _LONG_LONG_FORMAT_PREFIX "L"
77 #else
78 # define _LONG_LONG_FORMAT_PREFIX "ll"
79 #endif
81 #if !defined PRId8 || @PRI_MACROS_BROKEN@
82 # undef PRId8
83 # ifdef INT8_MAX
84 # define PRId8 "d"
85 # endif
86 #endif
87 #if !defined PRIi8 || @PRI_MACROS_BROKEN@
88 # undef PRIi8
89 # ifdef INT8_MAX
90 # define PRIi8 "i"
91 # endif
92 #endif
93 #if !defined PRIo8 || @PRI_MACROS_BROKEN@
94 # undef PRIo8
95 # ifdef UINT8_MAX
96 # define PRIo8 "o"
97 # endif
98 #endif
99 #if !defined PRIu8 || @PRI_MACROS_BROKEN@
100 # undef PRIu8
101 # ifdef UINT8_MAX
102 # define PRIu8 "u"
103 # endif
104 #endif
105 #if !defined PRIx8 || @PRI_MACROS_BROKEN@
106 # undef PRIx8
107 # ifdef UINT8_MAX
108 # define PRIx8 "x"
109 # endif
110 #endif
111 #if !defined PRIX8 || @PRI_MACROS_BROKEN@
112 # undef PRIX8
113 # ifdef UINT8_MAX
114 # define PRIX8 "X"
115 # endif
116 #endif
117 #if !defined PRId16 || @PRI_MACROS_BROKEN@
118 # undef PRId16
119 # ifdef INT16_MAX
120 # define PRId16 "d"
121 # endif
122 #endif
123 #if !defined PRIi16 || @PRI_MACROS_BROKEN@
124 # undef PRIi16
125 # ifdef INT16_MAX
126 # define PRIi16 "i"
127 # endif
128 #endif
129 #if !defined PRIo16 || @PRI_MACROS_BROKEN@
130 # undef PRIo16
131 # ifdef UINT16_MAX
132 # define PRIo16 "o"
133 # endif
134 #endif
135 #if !defined PRIu16 || @PRI_MACROS_BROKEN@
136 # undef PRIu16
137 # ifdef UINT16_MAX
138 # define PRIu16 "u"
139 # endif
140 #endif
141 #if !defined PRIx16 || @PRI_MACROS_BROKEN@
142 # undef PRIx16
143 # ifdef UINT16_MAX
144 # define PRIx16 "x"
145 # endif
146 #endif
147 #if !defined PRIX16 || @PRI_MACROS_BROKEN@
148 # undef PRIX16
149 # ifdef UINT16_MAX
150 # define PRIX16 "X"
151 # endif
152 #endif
153 #if !defined PRId32 || @PRI_MACROS_BROKEN@
154 # undef PRId32
155 # ifdef INT32_MAX
156 # define PRId32 "d"
157 # endif
158 #endif
159 #if !defined PRIi32 || @PRI_MACROS_BROKEN@
160 # undef PRIi32
161 # ifdef INT32_MAX
162 # define PRIi32 "i"
163 # endif
164 #endif
165 #if !defined PRIo32 || @PRI_MACROS_BROKEN@
166 # undef PRIo32
167 # ifdef UINT32_MAX
168 # define PRIo32 "o"
169 # endif
170 #endif
171 #if !defined PRIu32 || @PRI_MACROS_BROKEN@
172 # undef PRIu32
173 # ifdef UINT32_MAX
174 # define PRIu32 "u"
175 # endif
176 #endif
177 #if !defined PRIx32 || @PRI_MACROS_BROKEN@
178 # undef PRIx32
179 # ifdef UINT32_MAX
180 # define PRIx32 "x"
181 # endif
182 #endif
183 #if !defined PRIX32 || @PRI_MACROS_BROKEN@
184 # undef PRIX32
185 # ifdef UINT32_MAX
186 # define PRIX32 "X"
187 # endif
188 #endif
189 #ifdef INT64_MAX
190 # if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
191 # define _PRI64_PREFIX "l"
192 # elif defined _MSC_VER || defined __MINGW32__
193 # define _PRI64_PREFIX "I64"
194 # elif LONG_MAX >> 30 == 1
195 # define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
196 # endif
197 # if !defined PRId64 || @PRI_MACROS_BROKEN@
198 # undef PRId64
199 # define PRId64 _PRI64_PREFIX "d"
200 # endif
201 # if !defined PRIi64 || @PRI_MACROS_BROKEN@
202 # undef PRIi64
203 # define PRIi64 _PRI64_PREFIX "i"
204 # endif
205 #endif
206 #ifdef UINT64_MAX
207 # if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
208 # define _PRIu64_PREFIX "l"
209 # elif defined _MSC_VER || defined __MINGW32__
210 # define _PRIu64_PREFIX "I64"
211 # elif ULONG_MAX >> 31 == 1
212 # define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
213 # endif
214 # if !defined PRIo64 || @PRI_MACROS_BROKEN@
215 # undef PRIo64
216 # define PRIo64 _PRIu64_PREFIX "o"
217 # endif
218 # if !defined PRIu64 || @PRI_MACROS_BROKEN@
219 # undef PRIu64
220 # define PRIu64 _PRIu64_PREFIX "u"
221 # endif
222 # if !defined PRIx64 || @PRI_MACROS_BROKEN@
223 # undef PRIx64
224 # define PRIx64 _PRIu64_PREFIX "x"
225 # endif
226 # if !defined PRIX64 || @PRI_MACROS_BROKEN@
227 # undef PRIX64
228 # define PRIX64 _PRIu64_PREFIX "X"
229 # endif
230 #endif
232 #if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@
233 # undef PRIdLEAST8
234 # define PRIdLEAST8 "d"
235 #endif
236 #if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@
237 # undef PRIiLEAST8
238 # define PRIiLEAST8 "i"
239 #endif
240 #if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@
241 # undef PRIoLEAST8
242 # define PRIoLEAST8 "o"
243 #endif
244 #if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@
245 # undef PRIuLEAST8
246 # define PRIuLEAST8 "u"
247 #endif
248 #if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@
249 # undef PRIxLEAST8
250 # define PRIxLEAST8 "x"
251 #endif
252 #if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@
253 # undef PRIXLEAST8
254 # define PRIXLEAST8 "X"
255 #endif
256 #if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@
257 # undef PRIdLEAST16
258 # define PRIdLEAST16 "d"
259 #endif
260 #if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@
261 # undef PRIiLEAST16
262 # define PRIiLEAST16 "i"
263 #endif
264 #if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@
265 # undef PRIoLEAST16
266 # define PRIoLEAST16 "o"
267 #endif
268 #if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@
269 # undef PRIuLEAST16
270 # define PRIuLEAST16 "u"
271 #endif
272 #if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@
273 # undef PRIxLEAST16
274 # define PRIxLEAST16 "x"
275 #endif
276 #if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@
277 # undef PRIXLEAST16
278 # define PRIXLEAST16 "X"
279 #endif
280 #if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@
281 # undef PRIdLEAST32
282 # define PRIdLEAST32 "d"
283 #endif
284 #if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@
285 # undef PRIiLEAST32
286 # define PRIiLEAST32 "i"
287 #endif
288 #if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@
289 # undef PRIoLEAST32
290 # define PRIoLEAST32 "o"
291 #endif
292 #if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@
293 # undef PRIuLEAST32
294 # define PRIuLEAST32 "u"
295 #endif
296 #if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@
297 # undef PRIxLEAST32
298 # define PRIxLEAST32 "x"
299 #endif
300 #if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@
301 # undef PRIXLEAST32
302 # define PRIXLEAST32 "X"
303 #endif
304 #ifdef INT64_MAX
305 # if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@
306 # undef PRIdLEAST64
307 # define PRIdLEAST64 PRId64
308 # endif
309 # if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@
310 # undef PRIiLEAST64
311 # define PRIiLEAST64 PRIi64
312 # endif
313 #endif
314 #ifdef UINT64_MAX
315 # if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@
316 # undef PRIoLEAST64
317 # define PRIoLEAST64 PRIo64
318 # endif
319 # if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@
320 # undef PRIuLEAST64
321 # define PRIuLEAST64 PRIu64
322 # endif
323 # if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@
324 # undef PRIxLEAST64
325 # define PRIxLEAST64 PRIx64
326 # endif
327 # if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@
328 # undef PRIXLEAST64
329 # define PRIXLEAST64 PRIX64
330 # endif
331 #endif
333 #if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@
334 # undef PRIdFAST8
335 # if INT_FAST8_MAX > INT32_MAX
336 # define PRIdFAST8 PRId64
337 # else
338 # define PRIdFAST8 "d"
339 # endif
340 #endif
341 #if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@
342 # undef PRIiFAST8
343 # if INT_FAST8_MAX > INT32_MAX
344 # define PRIiFAST8 PRIi64
345 # else
346 # define PRIiFAST8 "i"
347 # endif
348 #endif
349 #if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@
350 # undef PRIoFAST8
351 # if UINT_FAST8_MAX > UINT32_MAX
352 # define PRIoFAST8 PRIo64
353 # else
354 # define PRIoFAST8 "o"
355 # endif
356 #endif
357 #if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@
358 # undef PRIuFAST8
359 # if UINT_FAST8_MAX > UINT32_MAX
360 # define PRIuFAST8 PRIu64
361 # else
362 # define PRIuFAST8 "u"
363 # endif
364 #endif
365 #if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@
366 # undef PRIxFAST8
367 # if UINT_FAST8_MAX > UINT32_MAX
368 # define PRIxFAST8 PRIx64
369 # else
370 # define PRIxFAST8 "x"
371 # endif
372 #endif
373 #if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@
374 # undef PRIXFAST8
375 # if UINT_FAST8_MAX > UINT32_MAX
376 # define PRIXFAST8 PRIX64
377 # else
378 # define PRIXFAST8 "X"
379 # endif
380 #endif
381 #if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@
382 # undef PRIdFAST16
383 # if INT_FAST16_MAX > INT32_MAX
384 # define PRIdFAST16 PRId64
385 # else
386 # define PRIdFAST16 "d"
387 # endif
388 #endif
389 #if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@
390 # undef PRIiFAST16
391 # if INT_FAST16_MAX > INT32_MAX
392 # define PRIiFAST16 PRIi64
393 # else
394 # define PRIiFAST16 "i"
395 # endif
396 #endif
397 #if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@
398 # undef PRIoFAST16
399 # if UINT_FAST16_MAX > UINT32_MAX
400 # define PRIoFAST16 PRIo64
401 # else
402 # define PRIoFAST16 "o"
403 # endif
404 #endif
405 #if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@
406 # undef PRIuFAST16
407 # if UINT_FAST16_MAX > UINT32_MAX
408 # define PRIuFAST16 PRIu64
409 # else
410 # define PRIuFAST16 "u"
411 # endif
412 #endif
413 #if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@
414 # undef PRIxFAST16
415 # if UINT_FAST16_MAX > UINT32_MAX
416 # define PRIxFAST16 PRIx64
417 # else
418 # define PRIxFAST16 "x"
419 # endif
420 #endif
421 #if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@
422 # undef PRIXFAST16
423 # if UINT_FAST16_MAX > UINT32_MAX
424 # define PRIXFAST16 PRIX64
425 # else
426 # define PRIXFAST16 "X"
427 # endif
428 #endif
429 #if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@
430 # undef PRIdFAST32
431 # if INT_FAST32_MAX > INT32_MAX
432 # define PRIdFAST32 PRId64
433 # else
434 # define PRIdFAST32 "d"
435 # endif
436 #endif
437 #if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@
438 # undef PRIiFAST32
439 # if INT_FAST32_MAX > INT32_MAX
440 # define PRIiFAST32 PRIi64
441 # else
442 # define PRIiFAST32 "i"
443 # endif
444 #endif
445 #if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@
446 # undef PRIoFAST32
447 # if UINT_FAST32_MAX > UINT32_MAX
448 # define PRIoFAST32 PRIo64
449 # else
450 # define PRIoFAST32 "o"
451 # endif
452 #endif
453 #if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@
454 # undef PRIuFAST32
455 # if UINT_FAST32_MAX > UINT32_MAX
456 # define PRIuFAST32 PRIu64
457 # else
458 # define PRIuFAST32 "u"
459 # endif
460 #endif
461 #if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@
462 # undef PRIxFAST32
463 # if UINT_FAST32_MAX > UINT32_MAX
464 # define PRIxFAST32 PRIx64
465 # else
466 # define PRIxFAST32 "x"
467 # endif
468 #endif
469 #if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@
470 # undef PRIXFAST32
471 # if UINT_FAST32_MAX > UINT32_MAX
472 # define PRIXFAST32 PRIX64
473 # else
474 # define PRIXFAST32 "X"
475 # endif
476 #endif
477 #ifdef INT64_MAX
478 # if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@
479 # undef PRIdFAST64
480 # define PRIdFAST64 PRId64
481 # endif
482 # if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@
483 # undef PRIiFAST64
484 # define PRIiFAST64 PRIi64
485 # endif
486 #endif
487 #ifdef UINT64_MAX
488 # if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@
489 # undef PRIoFAST64
490 # define PRIoFAST64 PRIo64
491 # endif
492 # if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@
493 # undef PRIuFAST64
494 # define PRIuFAST64 PRIu64
495 # endif
496 # if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@
497 # undef PRIxFAST64
498 # define PRIxFAST64 PRIx64
499 # endif
500 # if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@
501 # undef PRIXFAST64
502 # define PRIXFAST64 PRIX64
503 # endif
504 #endif
506 #if !defined PRIdMAX || @PRI_MACROS_BROKEN@
507 # undef PRIdMAX
508 # if @INT32_MAX_LT_INTMAX_MAX@
509 # define PRIdMAX PRId64
510 # else
511 # define PRIdMAX "ld"
512 # endif
513 #endif
514 #if !defined PRIiMAX || @PRI_MACROS_BROKEN@
515 # undef PRIiMAX
516 # if @INT32_MAX_LT_INTMAX_MAX@
517 # define PRIiMAX PRIi64
518 # else
519 # define PRIiMAX "li"
520 # endif
521 #endif
522 #if !defined PRIoMAX || @PRI_MACROS_BROKEN@
523 # undef PRIoMAX
524 # if @UINT32_MAX_LT_UINTMAX_MAX@
525 # define PRIoMAX PRIo64
526 # else
527 # define PRIoMAX "lo"
528 # endif
529 #endif
530 #if !defined PRIuMAX || @PRI_MACROS_BROKEN@
531 # undef PRIuMAX
532 # if @UINT32_MAX_LT_UINTMAX_MAX@
533 # define PRIuMAX PRIu64
534 # else
535 # define PRIuMAX "lu"
536 # endif
537 #endif
538 #if !defined PRIxMAX || @PRI_MACROS_BROKEN@
539 # undef PRIxMAX
540 # if @UINT32_MAX_LT_UINTMAX_MAX@
541 # define PRIxMAX PRIx64
542 # else
543 # define PRIxMAX "lx"
544 # endif
545 #endif
546 #if !defined PRIXMAX || @PRI_MACROS_BROKEN@
547 # undef PRIXMAX
548 # if @UINT32_MAX_LT_UINTMAX_MAX@
549 # define PRIXMAX PRIX64
550 # else
551 # define PRIXMAX "lX"
552 # endif
553 #endif
555 #if !defined PRIdPTR || @PRI_MACROS_BROKEN@
556 # undef PRIdPTR
557 # ifdef INTPTR_MAX
558 # define PRIdPTR @PRIPTR_PREFIX@ "d"
559 # endif
560 #endif
561 #if !defined PRIiPTR || @PRI_MACROS_BROKEN@
562 # undef PRIiPTR
563 # ifdef INTPTR_MAX
564 # define PRIiPTR @PRIPTR_PREFIX@ "i"
565 # endif
566 #endif
567 #if !defined PRIoPTR || @PRI_MACROS_BROKEN@
568 # undef PRIoPTR
569 # ifdef UINTPTR_MAX
570 # define PRIoPTR @PRIPTR_PREFIX@ "o"
571 # endif
572 #endif
573 #if !defined PRIuPTR || @PRI_MACROS_BROKEN@
574 # undef PRIuPTR
575 # ifdef UINTPTR_MAX
576 # define PRIuPTR @PRIPTR_PREFIX@ "u"
577 # endif
578 #endif
579 #if !defined PRIxPTR || @PRI_MACROS_BROKEN@
580 # undef PRIxPTR
581 # ifdef UINTPTR_MAX
582 # define PRIxPTR @PRIPTR_PREFIX@ "x"
583 # endif
584 #endif
585 #if !defined PRIXPTR || @PRI_MACROS_BROKEN@
586 # undef PRIXPTR
587 # ifdef UINTPTR_MAX
588 # define PRIXPTR @PRIPTR_PREFIX@ "X"
589 # endif
590 #endif
592 #if !defined SCNd8 || @PRI_MACROS_BROKEN@
593 # undef SCNd8
594 # ifdef INT8_MAX
595 # define SCNd8 "hhd"
596 # endif
597 #endif
598 #if !defined SCNi8 || @PRI_MACROS_BROKEN@
599 # undef SCNi8
600 # ifdef INT8_MAX
601 # define SCNi8 "hhi"
602 # endif
603 #endif
604 #if !defined SCNo8 || @PRI_MACROS_BROKEN@
605 # undef SCNo8
606 # ifdef UINT8_MAX
607 # define SCNo8 "hho"
608 # endif
609 #endif
610 #if !defined SCNu8 || @PRI_MACROS_BROKEN@
611 # undef SCNu8
612 # ifdef UINT8_MAX
613 # define SCNu8 "hhu"
614 # endif
615 #endif
616 #if !defined SCNx8 || @PRI_MACROS_BROKEN@
617 # undef SCNx8
618 # ifdef UINT8_MAX
619 # define SCNx8 "hhx"
620 # endif
621 #endif
622 #if !defined SCNd16 || @PRI_MACROS_BROKEN@
623 # undef SCNd16
624 # ifdef INT16_MAX
625 # define SCNd16 "hd"
626 # endif
627 #endif
628 #if !defined SCNi16 || @PRI_MACROS_BROKEN@
629 # undef SCNi16
630 # ifdef INT16_MAX
631 # define SCNi16 "hi"
632 # endif
633 #endif
634 #if !defined SCNo16 || @PRI_MACROS_BROKEN@
635 # undef SCNo16
636 # ifdef UINT16_MAX
637 # define SCNo16 "ho"
638 # endif
639 #endif
640 #if !defined SCNu16 || @PRI_MACROS_BROKEN@
641 # undef SCNu16
642 # ifdef UINT16_MAX
643 # define SCNu16 "hu"
644 # endif
645 #endif
646 #if !defined SCNx16 || @PRI_MACROS_BROKEN@
647 # undef SCNx16
648 # ifdef UINT16_MAX
649 # define SCNx16 "hx"
650 # endif
651 #endif
652 #if !defined SCNd32 || @PRI_MACROS_BROKEN@
653 # undef SCNd32
654 # ifdef INT32_MAX
655 # define SCNd32 "d"
656 # endif
657 #endif
658 #if !defined SCNi32 || @PRI_MACROS_BROKEN@
659 # undef SCNi32
660 # ifdef INT32_MAX
661 # define SCNi32 "i"
662 # endif
663 #endif
664 #if !defined SCNo32 || @PRI_MACROS_BROKEN@
665 # undef SCNo32
666 # ifdef UINT32_MAX
667 # define SCNo32 "o"
668 # endif
669 #endif
670 #if !defined SCNu32 || @PRI_MACROS_BROKEN@
671 # undef SCNu32
672 # ifdef UINT32_MAX
673 # define SCNu32 "u"
674 # endif
675 #endif
676 #if !defined SCNx32 || @PRI_MACROS_BROKEN@
677 # undef SCNx32
678 # ifdef UINT32_MAX
679 # define SCNx32 "x"
680 # endif
681 #endif
682 #ifdef INT64_MAX
683 # if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
684 # define _SCN64_PREFIX "l"
685 # elif defined _MSC_VER || defined __MINGW32__
686 # define _SCN64_PREFIX "I64"
687 # elif LONG_MAX >> 30 == 1
688 # define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
689 # endif
690 # if !defined SCNd64 || @PRI_MACROS_BROKEN@
691 # undef SCNd64
692 # define SCNd64 _SCN64_PREFIX "d"
693 # endif
694 # if !defined SCNi64 || @PRI_MACROS_BROKEN@
695 # undef SCNi64
696 # define SCNi64 _SCN64_PREFIX "i"
697 # endif
698 #endif
699 #ifdef UINT64_MAX
700 # if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
701 # define _SCNu64_PREFIX "l"
702 # elif defined _MSC_VER || defined __MINGW32__
703 # define _SCNu64_PREFIX "I64"
704 # elif ULONG_MAX >> 31 == 1
705 # define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
706 # endif
707 # if !defined SCNo64 || @PRI_MACROS_BROKEN@
708 # undef SCNo64
709 # define SCNo64 _SCNu64_PREFIX "o"
710 # endif
711 # if !defined SCNu64 || @PRI_MACROS_BROKEN@
712 # undef SCNu64
713 # define SCNu64 _SCNu64_PREFIX "u"
714 # endif
715 # if !defined SCNx64 || @PRI_MACROS_BROKEN@
716 # undef SCNx64
717 # define SCNx64 _SCNu64_PREFIX "x"
718 # endif
719 #endif
721 #if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@
722 # undef SCNdLEAST8
723 # define SCNdLEAST8 "hhd"
724 #endif
725 #if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@
726 # undef SCNiLEAST8
727 # define SCNiLEAST8 "hhi"
728 #endif
729 #if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@
730 # undef SCNoLEAST8
731 # define SCNoLEAST8 "hho"
732 #endif
733 #if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@
734 # undef SCNuLEAST8
735 # define SCNuLEAST8 "hhu"
736 #endif
737 #if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@
738 # undef SCNxLEAST8
739 # define SCNxLEAST8 "hhx"
740 #endif
741 #if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@
742 # undef SCNdLEAST16
743 # define SCNdLEAST16 "hd"
744 #endif
745 #if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@
746 # undef SCNiLEAST16
747 # define SCNiLEAST16 "hi"
748 #endif
749 #if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@
750 # undef SCNoLEAST16
751 # define SCNoLEAST16 "ho"
752 #endif
753 #if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@
754 # undef SCNuLEAST16
755 # define SCNuLEAST16 "hu"
756 #endif
757 #if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@
758 # undef SCNxLEAST16
759 # define SCNxLEAST16 "hx"
760 #endif
761 #if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@
762 # undef SCNdLEAST32
763 # define SCNdLEAST32 "d"
764 #endif
765 #if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@
766 # undef SCNiLEAST32
767 # define SCNiLEAST32 "i"
768 #endif
769 #if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@
770 # undef SCNoLEAST32
771 # define SCNoLEAST32 "o"
772 #endif
773 #if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@
774 # undef SCNuLEAST32
775 # define SCNuLEAST32 "u"
776 #endif
777 #if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@
778 # undef SCNxLEAST32
779 # define SCNxLEAST32 "x"
780 #endif
781 #ifdef INT64_MAX
782 # if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@
783 # undef SCNdLEAST64
784 # define SCNdLEAST64 SCNd64
785 # endif
786 # if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@
787 # undef SCNiLEAST64
788 # define SCNiLEAST64 SCNi64
789 # endif
790 #endif
791 #ifdef UINT64_MAX
792 # if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@
793 # undef SCNoLEAST64
794 # define SCNoLEAST64 SCNo64
795 # endif
796 # if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@
797 # undef SCNuLEAST64
798 # define SCNuLEAST64 SCNu64
799 # endif
800 # if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@
801 # undef SCNxLEAST64
802 # define SCNxLEAST64 SCNx64
803 # endif
804 #endif
806 #if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@
807 # undef SCNdFAST8
808 # if INT_FAST8_MAX > INT32_MAX
809 # define SCNdFAST8 SCNd64
810 # elif INT_FAST8_MAX == 0x7fff
811 # define SCNdFAST8 "hd"
812 # elif INT_FAST8_MAX == 0x7f
813 # define SCNdFAST8 "hhd"
814 # else
815 # define SCNdFAST8 "d"
816 # endif
817 #endif
818 #if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@
819 # undef SCNiFAST8
820 # if INT_FAST8_MAX > INT32_MAX
821 # define SCNiFAST8 SCNi64
822 # elif INT_FAST8_MAX == 0x7fff
823 # define SCNiFAST8 "hi"
824 # elif INT_FAST8_MAX == 0x7f
825 # define SCNiFAST8 "hhi"
826 # else
827 # define SCNiFAST8 "i"
828 # endif
829 #endif
830 #if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@
831 # undef SCNoFAST8
832 # if UINT_FAST8_MAX > UINT32_MAX
833 # define SCNoFAST8 SCNo64
834 # elif UINT_FAST8_MAX == 0xffff
835 # define SCNoFAST8 "ho"
836 # elif UINT_FAST8_MAX == 0xff
837 # define SCNoFAST8 "hho"
838 # else
839 # define SCNoFAST8 "o"
840 # endif
841 #endif
842 #if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@
843 # undef SCNuFAST8
844 # if UINT_FAST8_MAX > UINT32_MAX
845 # define SCNuFAST8 SCNu64
846 # elif UINT_FAST8_MAX == 0xffff
847 # define SCNuFAST8 "hu"
848 # elif UINT_FAST8_MAX == 0xff
849 # define SCNuFAST8 "hhu"
850 # else
851 # define SCNuFAST8 "u"
852 # endif
853 #endif
854 #if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@
855 # undef SCNxFAST8
856 # if UINT_FAST8_MAX > UINT32_MAX
857 # define SCNxFAST8 SCNx64
858 # elif UINT_FAST8_MAX == 0xffff
859 # define SCNxFAST8 "hx"
860 # elif UINT_FAST8_MAX == 0xff
861 # define SCNxFAST8 "hhx"
862 # else
863 # define SCNxFAST8 "x"
864 # endif
865 #endif
866 #if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@
867 # undef SCNdFAST16
868 # if INT_FAST16_MAX > INT32_MAX
869 # define SCNdFAST16 SCNd64
870 # elif INT_FAST16_MAX == 0x7fff
871 # define SCNdFAST16 "hd"
872 # else
873 # define SCNdFAST16 "d"
874 # endif
875 #endif
876 #if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@
877 # undef SCNiFAST16
878 # if INT_FAST16_MAX > INT32_MAX
879 # define SCNiFAST16 SCNi64
880 # elif INT_FAST16_MAX == 0x7fff
881 # define SCNiFAST16 "hi"
882 # else
883 # define SCNiFAST16 "i"
884 # endif
885 #endif
886 #if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@
887 # undef SCNoFAST16
888 # if UINT_FAST16_MAX > UINT32_MAX
889 # define SCNoFAST16 SCNo64
890 # elif UINT_FAST16_MAX == 0xffff
891 # define SCNoFAST16 "ho"
892 # else
893 # define SCNoFAST16 "o"
894 # endif
895 #endif
896 #if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@
897 # undef SCNuFAST16
898 # if UINT_FAST16_MAX > UINT32_MAX
899 # define SCNuFAST16 SCNu64
900 # elif UINT_FAST16_MAX == 0xffff
901 # define SCNuFAST16 "hu"
902 # else
903 # define SCNuFAST16 "u"
904 # endif
905 #endif
906 #if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@
907 # undef SCNxFAST16
908 # if UINT_FAST16_MAX > UINT32_MAX
909 # define SCNxFAST16 SCNx64
910 # elif UINT_FAST16_MAX == 0xffff
911 # define SCNxFAST16 "hx"
912 # else
913 # define SCNxFAST16 "x"
914 # endif
915 #endif
916 #if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@
917 # undef SCNdFAST32
918 # if INT_FAST32_MAX > INT32_MAX
919 # define SCNdFAST32 SCNd64
920 # else
921 # define SCNdFAST32 "d"
922 # endif
923 #endif
924 #if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@
925 # undef SCNiFAST32
926 # if INT_FAST32_MAX > INT32_MAX
927 # define SCNiFAST32 SCNi64
928 # else
929 # define SCNiFAST32 "i"
930 # endif
931 #endif
932 #if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@
933 # undef SCNoFAST32
934 # if UINT_FAST32_MAX > UINT32_MAX
935 # define SCNoFAST32 SCNo64
936 # else
937 # define SCNoFAST32 "o"
938 # endif
939 #endif
940 #if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@
941 # undef SCNuFAST32
942 # if UINT_FAST32_MAX > UINT32_MAX
943 # define SCNuFAST32 SCNu64
944 # else
945 # define SCNuFAST32 "u"
946 # endif
947 #endif
948 #if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@
949 # undef SCNxFAST32
950 # if UINT_FAST32_MAX > UINT32_MAX
951 # define SCNxFAST32 SCNx64
952 # else
953 # define SCNxFAST32 "x"
954 # endif
955 #endif
956 #ifdef INT64_MAX
957 # if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@
958 # undef SCNdFAST64
959 # define SCNdFAST64 SCNd64
960 # endif
961 # if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@
962 # undef SCNiFAST64
963 # define SCNiFAST64 SCNi64
964 # endif
965 #endif
966 #ifdef UINT64_MAX
967 # if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@
968 # undef SCNoFAST64
969 # define SCNoFAST64 SCNo64
970 # endif
971 # if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@
972 # undef SCNuFAST64
973 # define SCNuFAST64 SCNu64
974 # endif
975 # if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@
976 # undef SCNxFAST64
977 # define SCNxFAST64 SCNx64
978 # endif
979 #endif
981 #if !defined SCNdMAX || @PRI_MACROS_BROKEN@
982 # undef SCNdMAX
983 # if @INT32_MAX_LT_INTMAX_MAX@
984 # define SCNdMAX SCNd64
985 # else
986 # define SCNdMAX "ld"
987 # endif
988 #endif
989 #if !defined SCNiMAX || @PRI_MACROS_BROKEN@
990 # undef SCNiMAX
991 # if @INT32_MAX_LT_INTMAX_MAX@
992 # define SCNiMAX SCNi64
993 # else
994 # define SCNiMAX "li"
995 # endif
996 #endif
997 #if !defined SCNoMAX || @PRI_MACROS_BROKEN@
998 # undef SCNoMAX
999 # if @UINT32_MAX_LT_UINTMAX_MAX@
1000 # define SCNoMAX SCNo64
1001 # else
1002 # define SCNoMAX "lo"
1003 # endif
1004 #endif
1005 #if !defined SCNuMAX || @PRI_MACROS_BROKEN@
1006 # undef SCNuMAX
1007 # if @UINT32_MAX_LT_UINTMAX_MAX@
1008 # define SCNuMAX SCNu64
1009 # else
1010 # define SCNuMAX "lu"
1011 # endif
1012 #endif
1013 #if !defined SCNxMAX || @PRI_MACROS_BROKEN@
1014 # undef SCNxMAX
1015 # if @UINT32_MAX_LT_UINTMAX_MAX@
1016 # define SCNxMAX SCNx64
1017 # else
1018 # define SCNxMAX "lx"
1019 # endif
1020 #endif
1022 #if !defined SCNdPTR || @PRI_MACROS_BROKEN@
1023 # undef SCNdPTR
1024 # ifdef INTPTR_MAX
1025 # define SCNdPTR @PRIPTR_PREFIX@ "d"
1026 # endif
1027 #endif
1028 #if !defined SCNiPTR || @PRI_MACROS_BROKEN@
1029 # undef SCNiPTR
1030 # ifdef INTPTR_MAX
1031 # define SCNiPTR @PRIPTR_PREFIX@ "i"
1032 # endif
1033 #endif
1034 #if !defined SCNoPTR || @PRI_MACROS_BROKEN@
1035 # undef SCNoPTR
1036 # ifdef UINTPTR_MAX
1037 # define SCNoPTR @PRIPTR_PREFIX@ "o"
1038 # endif
1039 #endif
1040 #if !defined SCNuPTR || @PRI_MACROS_BROKEN@
1041 # undef SCNuPTR
1042 # ifdef UINTPTR_MAX
1043 # define SCNuPTR @PRIPTR_PREFIX@ "u"
1044 # endif
1045 #endif
1046 #if !defined SCNxPTR || @PRI_MACROS_BROKEN@
1047 # undef SCNxPTR
1048 # ifdef UINTPTR_MAX
1049 # define SCNxPTR @PRIPTR_PREFIX@ "x"
1050 # endif
1051 #endif
1053 /* 7.8.2 Functions for greatest-width integer types */
1055 #ifdef __cplusplus
1056 extern "C" {
1057 #endif
1059 #if @GNULIB_IMAXABS@
1060 # if !@HAVE_DECL_IMAXABS@
1061 extern intmax_t imaxabs (intmax_t);
1062 # endif
1063 #elif defined GNULIB_POSIXCHECK
1064 # undef imaxabs
1065 # if HAVE_RAW_DECL_IMAXABS
1066 _GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - "
1067 "use gnulib module imaxabs for portability");
1068 # endif
1069 #endif
1071 #if @GNULIB_IMAXDIV@
1072 # if !@HAVE_IMAXDIV_T@
1073 # if !GNULIB_defined_imaxdiv_t
1074 typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
1075 # define GNULIB_defined_imaxdiv_t 1
1076 # endif
1077 # endif
1078 # if !@HAVE_DECL_IMAXDIV@
1079 extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
1080 # endif
1081 #elif defined GNULIB_POSIXCHECK
1082 # undef imaxdiv
1083 # if HAVE_RAW_DECL_IMAXDIV
1084 _GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
1085 "use gnulib module imaxdiv for portability");
1086 # endif
1087 #endif
1089 #if @GNULIB_STRTOIMAX@
1090 # if @REPLACE_STRTOIMAX@
1091 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1092 # undef strtoimax
1093 # define strtoimax rpl_strtoimax
1094 # endif
1095 _GL_FUNCDECL_RPL (strtoimax, intmax_t,
1096 (const char *restrict, char **restrict, int)
1097 _GL_ARG_NONNULL ((1)));
1098 _GL_CXXALIAS_RPL (strtoimax, intmax_t,
1099 (const char *restrict, char **restrict, int));
1100 # else
1101 # if !@HAVE_DECL_STRTOIMAX@
1102 # undef strtoimax
1103 _GL_FUNCDECL_SYS (strtoimax, intmax_t,
1104 (const char *restrict, char **restrict, int)
1105 _GL_ARG_NONNULL ((1)));
1106 # endif
1107 _GL_CXXALIAS_SYS (strtoimax, intmax_t,
1108 (const char *restrict, char **restrict, int));
1109 # endif
1110 _GL_CXXALIASWARN (strtoimax);
1111 #elif defined GNULIB_POSIXCHECK
1112 # undef strtoimax
1113 # if HAVE_RAW_DECL_STRTOIMAX
1114 _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
1115 "use gnulib module strtoimax for portability");
1116 # endif
1117 #endif
1119 #if @GNULIB_STRTOUMAX@
1120 # if @REPLACE_STRTOUMAX@
1121 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1122 # undef strtoumax
1123 # define strtoumax rpl_strtoumax
1124 # endif
1125 _GL_FUNCDECL_RPL (strtoumax, uintmax_t,
1126 (const char *restrict, char **restrict, int)
1127 _GL_ARG_NONNULL ((1)));
1128 _GL_CXXALIAS_RPL (strtoumax, uintmax_t,
1129 (const char *restrict, char **restrict, int));
1130 # else
1131 # if !@HAVE_DECL_STRTOUMAX@
1132 # undef strtoumax
1133 _GL_FUNCDECL_SYS (strtoumax, uintmax_t,
1134 (const char *restrict, char **restrict, int)
1135 _GL_ARG_NONNULL ((1)));
1136 # endif
1137 _GL_CXXALIAS_SYS (strtoumax, uintmax_t,
1138 (const char *restrict, char **restrict, int));
1139 # endif
1140 _GL_CXXALIASWARN (strtoumax);
1141 #elif defined GNULIB_POSIXCHECK
1142 # undef strtoumax
1143 # if HAVE_RAW_DECL_STRTOUMAX
1144 _GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - "
1145 "use gnulib module strtoumax for portability");
1146 # endif
1147 #endif
1149 /* Don't bother defining or declaring wcstoimax and wcstoumax, since
1150 wide-character functions like this are hardly ever useful. */
1152 #ifdef __cplusplus
1154 #endif
1156 #endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */