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>
24 @PRAGMA_SYSTEM_HEADER@
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
40 # @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
42 # define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H
46 #if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
49 /* Include <stdint.h> or the gnulib replacement.
50 But avoid namespace pollution on glibc systems. */
54 /* Get CHAR_BIT, INT_MAX, LONG_MAX, etc. */
56 /* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
57 #if defined _WIN32 && ! defined __CYGWIN__
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>."
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"
78 # define _LONG_LONG_FORMAT_PREFIX "ll"
81 #if !defined PRId8 || @PRI_MACROS_BROKEN@
87 #if !defined PRIi8 || @PRI_MACROS_BROKEN@
93 #if !defined PRIo8 || @PRI_MACROS_BROKEN@
99 #if !defined PRIu8 || @PRI_MACROS_BROKEN@
105 #if !defined PRIx8 || @PRI_MACROS_BROKEN@
111 #if !defined PRIX8 || @PRI_MACROS_BROKEN@
117 #if !defined PRId16 || @PRI_MACROS_BROKEN@
123 #if !defined PRIi16 || @PRI_MACROS_BROKEN@
129 #if !defined PRIo16 || @PRI_MACROS_BROKEN@
135 #if !defined PRIu16 || @PRI_MACROS_BROKEN@
141 #if !defined PRIx16 || @PRI_MACROS_BROKEN@
147 #if !defined PRIX16 || @PRI_MACROS_BROKEN@
153 #if !defined PRId32 || @PRI_MACROS_BROKEN@
159 #if !defined PRIi32 || @PRI_MACROS_BROKEN@
165 #if !defined PRIo32 || @PRI_MACROS_BROKEN@
171 #if !defined PRIu32 || @PRI_MACROS_BROKEN@
177 #if !defined PRIx32 || @PRI_MACROS_BROKEN@
183 #if !defined PRIX32 || @PRI_MACROS_BROKEN@
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
197 # if !defined PRId64 || @PRI_MACROS_BROKEN@
199 # define PRId64 _PRI64_PREFIX "d"
201 # if !defined PRIi64 || @PRI_MACROS_BROKEN@
203 # define PRIi64 _PRI64_PREFIX "i"
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
214 # if !defined PRIo64 || @PRI_MACROS_BROKEN@
216 # define PRIo64 _PRIu64_PREFIX "o"
218 # if !defined PRIu64 || @PRI_MACROS_BROKEN@
220 # define PRIu64 _PRIu64_PREFIX "u"
222 # if !defined PRIx64 || @PRI_MACROS_BROKEN@
224 # define PRIx64 _PRIu64_PREFIX "x"
226 # if !defined PRIX64 || @PRI_MACROS_BROKEN@
228 # define PRIX64 _PRIu64_PREFIX "X"
232 #if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@
234 # define PRIdLEAST8 "d"
236 #if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@
238 # define PRIiLEAST8 "i"
240 #if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@
242 # define PRIoLEAST8 "o"
244 #if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@
246 # define PRIuLEAST8 "u"
248 #if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@
250 # define PRIxLEAST8 "x"
252 #if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@
254 # define PRIXLEAST8 "X"
256 #if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@
258 # define PRIdLEAST16 "d"
260 #if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@
262 # define PRIiLEAST16 "i"
264 #if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@
266 # define PRIoLEAST16 "o"
268 #if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@
270 # define PRIuLEAST16 "u"
272 #if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@
274 # define PRIxLEAST16 "x"
276 #if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@
278 # define PRIXLEAST16 "X"
280 #if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@
282 # define PRIdLEAST32 "d"
284 #if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@
286 # define PRIiLEAST32 "i"
288 #if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@
290 # define PRIoLEAST32 "o"
292 #if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@
294 # define PRIuLEAST32 "u"
296 #if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@
298 # define PRIxLEAST32 "x"
300 #if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@
302 # define PRIXLEAST32 "X"
305 # if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@
307 # define PRIdLEAST64 PRId64
309 # if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@
311 # define PRIiLEAST64 PRIi64
315 # if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@
317 # define PRIoLEAST64 PRIo64
319 # if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@
321 # define PRIuLEAST64 PRIu64
323 # if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@
325 # define PRIxLEAST64 PRIx64
327 # if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@
329 # define PRIXLEAST64 PRIX64
333 #if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@
335 # if INT_FAST8_MAX > INT32_MAX
336 # define PRIdFAST8 PRId64
338 # define PRIdFAST8 "d"
341 #if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@
343 # if INT_FAST8_MAX > INT32_MAX
344 # define PRIiFAST8 PRIi64
346 # define PRIiFAST8 "i"
349 #if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@
351 # if UINT_FAST8_MAX > UINT32_MAX
352 # define PRIoFAST8 PRIo64
354 # define PRIoFAST8 "o"
357 #if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@
359 # if UINT_FAST8_MAX > UINT32_MAX
360 # define PRIuFAST8 PRIu64
362 # define PRIuFAST8 "u"
365 #if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@
367 # if UINT_FAST8_MAX > UINT32_MAX
368 # define PRIxFAST8 PRIx64
370 # define PRIxFAST8 "x"
373 #if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@
375 # if UINT_FAST8_MAX > UINT32_MAX
376 # define PRIXFAST8 PRIX64
378 # define PRIXFAST8 "X"
381 #if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@
383 # if INT_FAST16_MAX > INT32_MAX
384 # define PRIdFAST16 PRId64
386 # define PRIdFAST16 "d"
389 #if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@
391 # if INT_FAST16_MAX > INT32_MAX
392 # define PRIiFAST16 PRIi64
394 # define PRIiFAST16 "i"
397 #if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@
399 # if UINT_FAST16_MAX > UINT32_MAX
400 # define PRIoFAST16 PRIo64
402 # define PRIoFAST16 "o"
405 #if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@
407 # if UINT_FAST16_MAX > UINT32_MAX
408 # define PRIuFAST16 PRIu64
410 # define PRIuFAST16 "u"
413 #if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@
415 # if UINT_FAST16_MAX > UINT32_MAX
416 # define PRIxFAST16 PRIx64
418 # define PRIxFAST16 "x"
421 #if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@
423 # if UINT_FAST16_MAX > UINT32_MAX
424 # define PRIXFAST16 PRIX64
426 # define PRIXFAST16 "X"
429 #if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@
431 # if INT_FAST32_MAX > INT32_MAX
432 # define PRIdFAST32 PRId64
434 # define PRIdFAST32 "d"
437 #if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@
439 # if INT_FAST32_MAX > INT32_MAX
440 # define PRIiFAST32 PRIi64
442 # define PRIiFAST32 "i"
445 #if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@
447 # if UINT_FAST32_MAX > UINT32_MAX
448 # define PRIoFAST32 PRIo64
450 # define PRIoFAST32 "o"
453 #if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@
455 # if UINT_FAST32_MAX > UINT32_MAX
456 # define PRIuFAST32 PRIu64
458 # define PRIuFAST32 "u"
461 #if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@
463 # if UINT_FAST32_MAX > UINT32_MAX
464 # define PRIxFAST32 PRIx64
466 # define PRIxFAST32 "x"
469 #if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@
471 # if UINT_FAST32_MAX > UINT32_MAX
472 # define PRIXFAST32 PRIX64
474 # define PRIXFAST32 "X"
478 # if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@
480 # define PRIdFAST64 PRId64
482 # if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@
484 # define PRIiFAST64 PRIi64
488 # if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@
490 # define PRIoFAST64 PRIo64
492 # if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@
494 # define PRIuFAST64 PRIu64
496 # if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@
498 # define PRIxFAST64 PRIx64
500 # if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@
502 # define PRIXFAST64 PRIX64
506 #if !defined PRIdMAX || @PRI_MACROS_BROKEN@
508 # if @INT32_MAX_LT_INTMAX_MAX@
509 # define PRIdMAX PRId64
511 # define PRIdMAX "ld"
514 #if !defined PRIiMAX || @PRI_MACROS_BROKEN@
516 # if @INT32_MAX_LT_INTMAX_MAX@
517 # define PRIiMAX PRIi64
519 # define PRIiMAX "li"
522 #if !defined PRIoMAX || @PRI_MACROS_BROKEN@
524 # if @UINT32_MAX_LT_UINTMAX_MAX@
525 # define PRIoMAX PRIo64
527 # define PRIoMAX "lo"
530 #if !defined PRIuMAX || @PRI_MACROS_BROKEN@
532 # if @UINT32_MAX_LT_UINTMAX_MAX@
533 # define PRIuMAX PRIu64
535 # define PRIuMAX "lu"
538 #if !defined PRIxMAX || @PRI_MACROS_BROKEN@
540 # if @UINT32_MAX_LT_UINTMAX_MAX@
541 # define PRIxMAX PRIx64
543 # define PRIxMAX "lx"
546 #if !defined PRIXMAX || @PRI_MACROS_BROKEN@
548 # if @UINT32_MAX_LT_UINTMAX_MAX@
549 # define PRIXMAX PRIX64
551 # define PRIXMAX "lX"
555 #if !defined PRIdPTR || @PRI_MACROS_BROKEN@
558 # define PRIdPTR @PRIPTR_PREFIX@ "d"
561 #if !defined PRIiPTR || @PRI_MACROS_BROKEN@
564 # define PRIiPTR @PRIPTR_PREFIX@ "i"
567 #if !defined PRIoPTR || @PRI_MACROS_BROKEN@
570 # define PRIoPTR @PRIPTR_PREFIX@ "o"
573 #if !defined PRIuPTR || @PRI_MACROS_BROKEN@
576 # define PRIuPTR @PRIPTR_PREFIX@ "u"
579 #if !defined PRIxPTR || @PRI_MACROS_BROKEN@
582 # define PRIxPTR @PRIPTR_PREFIX@ "x"
585 #if !defined PRIXPTR || @PRI_MACROS_BROKEN@
588 # define PRIXPTR @PRIPTR_PREFIX@ "X"
592 #if !defined SCNd8 || @PRI_MACROS_BROKEN@
598 #if !defined SCNi8 || @PRI_MACROS_BROKEN@
604 #if !defined SCNo8 || @PRI_MACROS_BROKEN@
610 #if !defined SCNu8 || @PRI_MACROS_BROKEN@
616 #if !defined SCNx8 || @PRI_MACROS_BROKEN@
622 #if !defined SCNd16 || @PRI_MACROS_BROKEN@
628 #if !defined SCNi16 || @PRI_MACROS_BROKEN@
634 #if !defined SCNo16 || @PRI_MACROS_BROKEN@
640 #if !defined SCNu16 || @PRI_MACROS_BROKEN@
646 #if !defined SCNx16 || @PRI_MACROS_BROKEN@
652 #if !defined SCNd32 || @PRI_MACROS_BROKEN@
658 #if !defined SCNi32 || @PRI_MACROS_BROKEN@
664 #if !defined SCNo32 || @PRI_MACROS_BROKEN@
670 #if !defined SCNu32 || @PRI_MACROS_BROKEN@
676 #if !defined SCNx32 || @PRI_MACROS_BROKEN@
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
690 # if !defined SCNd64 || @PRI_MACROS_BROKEN@
692 # define SCNd64 _SCN64_PREFIX "d"
694 # if !defined SCNi64 || @PRI_MACROS_BROKEN@
696 # define SCNi64 _SCN64_PREFIX "i"
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
707 # if !defined SCNo64 || @PRI_MACROS_BROKEN@
709 # define SCNo64 _SCNu64_PREFIX "o"
711 # if !defined SCNu64 || @PRI_MACROS_BROKEN@
713 # define SCNu64 _SCNu64_PREFIX "u"
715 # if !defined SCNx64 || @PRI_MACROS_BROKEN@
717 # define SCNx64 _SCNu64_PREFIX "x"
721 #if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@
723 # define SCNdLEAST8 "hhd"
725 #if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@
727 # define SCNiLEAST8 "hhi"
729 #if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@
731 # define SCNoLEAST8 "hho"
733 #if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@
735 # define SCNuLEAST8 "hhu"
737 #if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@
739 # define SCNxLEAST8 "hhx"
741 #if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@
743 # define SCNdLEAST16 "hd"
745 #if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@
747 # define SCNiLEAST16 "hi"
749 #if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@
751 # define SCNoLEAST16 "ho"
753 #if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@
755 # define SCNuLEAST16 "hu"
757 #if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@
759 # define SCNxLEAST16 "hx"
761 #if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@
763 # define SCNdLEAST32 "d"
765 #if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@
767 # define SCNiLEAST32 "i"
769 #if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@
771 # define SCNoLEAST32 "o"
773 #if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@
775 # define SCNuLEAST32 "u"
777 #if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@
779 # define SCNxLEAST32 "x"
782 # if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@
784 # define SCNdLEAST64 SCNd64
786 # if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@
788 # define SCNiLEAST64 SCNi64
792 # if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@
794 # define SCNoLEAST64 SCNo64
796 # if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@
798 # define SCNuLEAST64 SCNu64
800 # if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@
802 # define SCNxLEAST64 SCNx64
806 #if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@
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"
815 # define SCNdFAST8 "d"
818 #if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@
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"
827 # define SCNiFAST8 "i"
830 #if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@
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"
839 # define SCNoFAST8 "o"
842 #if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@
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"
851 # define SCNuFAST8 "u"
854 #if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@
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"
863 # define SCNxFAST8 "x"
866 #if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@
868 # if INT_FAST16_MAX > INT32_MAX
869 # define SCNdFAST16 SCNd64
870 # elif INT_FAST16_MAX == 0x7fff
871 # define SCNdFAST16 "hd"
873 # define SCNdFAST16 "d"
876 #if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@
878 # if INT_FAST16_MAX > INT32_MAX
879 # define SCNiFAST16 SCNi64
880 # elif INT_FAST16_MAX == 0x7fff
881 # define SCNiFAST16 "hi"
883 # define SCNiFAST16 "i"
886 #if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@
888 # if UINT_FAST16_MAX > UINT32_MAX
889 # define SCNoFAST16 SCNo64
890 # elif UINT_FAST16_MAX == 0xffff
891 # define SCNoFAST16 "ho"
893 # define SCNoFAST16 "o"
896 #if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@
898 # if UINT_FAST16_MAX > UINT32_MAX
899 # define SCNuFAST16 SCNu64
900 # elif UINT_FAST16_MAX == 0xffff
901 # define SCNuFAST16 "hu"
903 # define SCNuFAST16 "u"
906 #if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@
908 # if UINT_FAST16_MAX > UINT32_MAX
909 # define SCNxFAST16 SCNx64
910 # elif UINT_FAST16_MAX == 0xffff
911 # define SCNxFAST16 "hx"
913 # define SCNxFAST16 "x"
916 #if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@
918 # if INT_FAST32_MAX > INT32_MAX
919 # define SCNdFAST32 SCNd64
921 # define SCNdFAST32 "d"
924 #if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@
926 # if INT_FAST32_MAX > INT32_MAX
927 # define SCNiFAST32 SCNi64
929 # define SCNiFAST32 "i"
932 #if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@
934 # if UINT_FAST32_MAX > UINT32_MAX
935 # define SCNoFAST32 SCNo64
937 # define SCNoFAST32 "o"
940 #if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@
942 # if UINT_FAST32_MAX > UINT32_MAX
943 # define SCNuFAST32 SCNu64
945 # define SCNuFAST32 "u"
948 #if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@
950 # if UINT_FAST32_MAX > UINT32_MAX
951 # define SCNxFAST32 SCNx64
953 # define SCNxFAST32 "x"
957 # if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@
959 # define SCNdFAST64 SCNd64
961 # if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@
963 # define SCNiFAST64 SCNi64
967 # if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@
969 # define SCNoFAST64 SCNo64
971 # if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@
973 # define SCNuFAST64 SCNu64
975 # if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@
977 # define SCNxFAST64 SCNx64
981 #if !defined SCNdMAX || @PRI_MACROS_BROKEN@
983 # if @INT32_MAX_LT_INTMAX_MAX@
984 # define SCNdMAX SCNd64
986 # define SCNdMAX "ld"
989 #if !defined SCNiMAX || @PRI_MACROS_BROKEN@
991 # if @INT32_MAX_LT_INTMAX_MAX@
992 # define SCNiMAX SCNi64
994 # define SCNiMAX "li"
997 #if !defined SCNoMAX || @PRI_MACROS_BROKEN@
999 # if @UINT32_MAX_LT_UINTMAX_MAX@
1000 # define SCNoMAX SCNo64
1002 # define SCNoMAX "lo"
1005 #if !defined SCNuMAX || @PRI_MACROS_BROKEN@
1007 # if @UINT32_MAX_LT_UINTMAX_MAX@
1008 # define SCNuMAX SCNu64
1010 # define SCNuMAX "lu"
1013 #if !defined SCNxMAX || @PRI_MACROS_BROKEN@
1015 # if @UINT32_MAX_LT_UINTMAX_MAX@
1016 # define SCNxMAX SCNx64
1018 # define SCNxMAX "lx"
1022 #if !defined SCNdPTR || @PRI_MACROS_BROKEN@
1025 # define SCNdPTR @PRIPTR_PREFIX@ "d"
1028 #if !defined SCNiPTR || @PRI_MACROS_BROKEN@
1031 # define SCNiPTR @PRIPTR_PREFIX@ "i"
1034 #if !defined SCNoPTR || @PRI_MACROS_BROKEN@
1037 # define SCNoPTR @PRIPTR_PREFIX@ "o"
1040 #if !defined SCNuPTR || @PRI_MACROS_BROKEN@
1043 # define SCNuPTR @PRIPTR_PREFIX@ "u"
1046 #if !defined SCNxPTR || @PRI_MACROS_BROKEN@
1049 # define SCNxPTR @PRIPTR_PREFIX@ "x"
1053 /* 7.8.2 Functions for greatest-width integer types */
1059 #if @GNULIB_IMAXABS@
1060 # if !@HAVE_DECL_IMAXABS@
1061 extern intmax_t imaxabs (intmax_t);
1063 #elif defined GNULIB_POSIXCHECK
1065 # if HAVE_RAW_DECL_IMAXABS
1066 _GL_WARN_ON_USE (imaxabs
, "imaxabs is unportable - "
1067 "use gnulib module imaxabs for portability");
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
1078 # if !@HAVE_DECL_IMAXDIV@
1079 extern imaxdiv_t
imaxdiv (intmax_t, intmax_t);
1081 #elif defined GNULIB_POSIXCHECK
1083 # if HAVE_RAW_DECL_IMAXDIV
1084 _GL_WARN_ON_USE (imaxdiv
, "imaxdiv is unportable - "
1085 "use gnulib module imaxdiv for portability");
1089 #if @GNULIB_STRTOIMAX@
1090 # if @REPLACE_STRTOIMAX@
1091 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1093 # define strtoimax rpl_strtoimax
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));
1101 # if !@HAVE_DECL_STRTOIMAX@
1103 _GL_FUNCDECL_SYS (strtoimax
, intmax_t,
1104 (const char *restrict
, char **restrict
, int)
1105 _GL_ARG_NONNULL ((1)));
1107 _GL_CXXALIAS_SYS (strtoimax
, intmax_t,
1108 (const char *restrict
, char **restrict
, int));
1110 _GL_CXXALIASWARN (strtoimax
);
1111 #elif defined GNULIB_POSIXCHECK
1113 # if HAVE_RAW_DECL_STRTOIMAX
1114 _GL_WARN_ON_USE (strtoimax
, "strtoimax is unportable - "
1115 "use gnulib module strtoimax for portability");
1119 #if @GNULIB_STRTOUMAX@
1120 # if @REPLACE_STRTOUMAX@
1121 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1123 # define strtoumax rpl_strtoumax
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));
1131 # if !@HAVE_DECL_STRTOUMAX@
1133 _GL_FUNCDECL_SYS (strtoumax
, uintmax_t,
1134 (const char *restrict
, char **restrict
, int)
1135 _GL_ARG_NONNULL ((1)));
1137 _GL_CXXALIAS_SYS (strtoumax
, uintmax_t,
1138 (const char *restrict
, char **restrict
, int));
1140 _GL_CXXALIASWARN (strtoumax
);
1141 #elif defined GNULIB_POSIXCHECK
1143 # if HAVE_RAW_DECL_STRTOUMAX
1144 _GL_WARN_ON_USE (strtoumax
, "strtoumax is unportable - "
1145 "use gnulib module strtoumax for portability");
1149 /* Don't bother defining or declaring wcstoimax and wcstoumax, since
1150 wide-character functions like this are hardly ever useful. */
1156 #endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */