1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 2 /* Copyright (C) 2001-2002, 2004-2021 Free Software Foundation, Inc. 3 Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. 4 This file is part of gnulib. 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 3, or (at your option) 9 any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, see <https://www.gnu.org/licenses/>. */ 18 19 /* 20 * ISO C 99 <stdint.h> for platforms that lack it. 21 * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html> 22 */ 23 24 #ifndef _GL_STDINT_H 25 26 #if __GNUC__ >= 3 27 #pragma GCC system_header 28 #endif 29 30 31 /* When including a system file that in turn includes <inttypes.h>, 32 use the system <inttypes.h>, not our substitute. This avoids 33 problems with (for example) VMS, whose <sys/bitypes.h> includes 34 <inttypes.h>. */ 35 #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H 36 37 /* On Android (Bionic libc), <sys/types.h> includes this file before 38 having defined 'time_t'. Therefore in this case avoid including 39 other system header files; just include the system's <stdint.h>. 40 Ideally we should test __BIONIC__ here, but it is only defined after 41 <sys/cdefs.h> has been included; hence test __ANDROID__ instead. */ 42 #if defined __ANDROID__ && defined _GL_INCLUDING_SYS_TYPES_H 43 # include_next <stdint.h> 44 #else 45 46 /* Get those types that are already defined in other system include 47 files, so that we can "#define int8_t signed char" below without 48 worrying about a later system include file containing a "typedef 49 signed char int8_t;" that will get messed up by our macro. Our 50 macros should all be consistent with the system versions, except 51 for the "fast" types and macros, which we recommend against using 52 in public interfaces due to compiler differences. */ 53 54 #if 1 55 # if defined __sgi && ! defined __c99 56 /* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users 57 with "This header file is to be used only for c99 mode compilations" 58 diagnostics. */ 59 # define __STDINT_H__ 60 # endif 61 62 /* Some pre-C++11 <stdint.h> implementations need this. */ 63 # ifdef __cplusplus 64 # ifndef __STDC_CONSTANT_MACROS 65 # define __STDC_CONSTANT_MACROS 1 66 # endif 67 # ifndef __STDC_LIMIT_MACROS 68 # define __STDC_LIMIT_MACROS 1 69 # endif 70 # endif 71 72 /* Other systems may have an incomplete or buggy <stdint.h>. 73 Include it before <inttypes.h>, since any "#include <stdint.h>" 74 in <inttypes.h> would reinclude us, skipping our contents because 75 _GL_STDINT_H is defined. 76 The include_next requires a split double-inclusion guard. */ 77 # include_next <stdint.h> 78 #endif 79 80 #if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H 81 #define _GL_STDINT_H 82 83 /* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, 84 LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */ 85 #include <limits.h> 86 87 /* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides 88 wint_t. */ 89 #if 0 90 # undef WINT_MIN 91 # undef WINT_MAX 92 # define WINT_MIN 0x0U 93 # define WINT_MAX 0xffffffffU 94 #endif 95 96 #if ! 1 97 98 /* <sys/types.h> defines some of the stdint.h types as well, on glibc, 99 IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>). 100 AIX 5.2 <sys/types.h> isn't needed and causes troubles. 101 Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but 102 relies on the system <stdint.h> definitions, so include 103 <sys/types.h> after <stdint.h>. */ 104 # if 1 && ! defined _AIX 105 # include <sys/types.h> 106 # endif 107 108 # if 1 109 /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines 110 int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. 111 <inttypes.h> also defines intptr_t and uintptr_t. */ 112 # include <inttypes.h> 113 # elif 0 114 /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and 115 the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ 116 # include <sys/inttypes.h> 117 # endif 118 119 # if 0 && ! defined __BIT_TYPES_DEFINED__ 120 /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines 121 int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is 122 included by <sys/types.h>. */ 123 # include <sys/bitypes.h> 124 # endif 125 126 # undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H 127 128 /* Minimum and maximum values for an integer type under the usual assumption. 129 Return an unspecified value if BITS == 0, adding a check to pacify 130 picky compilers. */ 131 132 /* These are separate macros, because if you try to merge these macros into 133 a single one, HP-UX cc rejects the resulting expression in constant 134 expressions. */ 135 # define _STDINT_UNSIGNED_MIN(bits, zero) \ 136 (zero) 137 # define _STDINT_SIGNED_MIN(bits, zero) \ 138 (~ _STDINT_MAX (1, bits, zero)) 139 140 # define _STDINT_MAX(signed, bits, zero) \ 141 (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) 142 143 #if !GNULIB_defined_stdint_types 144 145 /* 7.18.1.1. Exact-width integer types */ 146 147 /* Here we assume a standard architecture where the hardware integer 148 types have 8, 16, 32, optionally 64 bits. */ 149 150 # undef int8_t 151 # undef uint8_t 152 typedef signed char gl_int8_t; 153 typedef unsigned char gl_uint8_t; 154 # define int8_t gl_int8_t 155 # define uint8_t gl_uint8_t 156 157 # undef int16_t 158 # undef uint16_t 159 typedef short int gl_int16_t; 160 typedef unsigned short int gl_uint16_t; 161 # define int16_t gl_int16_t 162 # define uint16_t gl_uint16_t 163 164 # undef int32_t 165 # undef uint32_t 166 typedef int gl_int32_t; 167 typedef unsigned int gl_uint32_t; 168 # define int32_t gl_int32_t 169 # define uint32_t gl_uint32_t 170 171 /* If the system defines INT64_MAX, assume int64_t works. That way, 172 if the underlying platform defines int64_t to be a 64-bit long long 173 int, the code below won't mistakenly define it to be a 64-bit long 174 int, which would mess up C++ name mangling. We must use #ifdef 175 rather than #if, to avoid an error with HP-UX 10.20 cc. */ 176 177 # ifdef INT64_MAX 178 # define GL_INT64_T 179 # else 180 /* Do not undefine int64_t if gnulib is not being used with 64-bit 181 types, since otherwise it breaks platforms like Tandem/NSK. */ 182 # if LONG_MAX >> 31 >> 31 == 1 183 # undef int64_t 184 typedef long int gl_int64_t; 185 # define int64_t gl_int64_t 186 # define GL_INT64_T 187 # elif defined _MSC_VER 188 # undef int64_t 189 typedef __int64 gl_int64_t; 190 # define int64_t gl_int64_t 191 # define GL_INT64_T 192 # else 193 # undef int64_t 194 typedef long long int gl_int64_t; 195 # define int64_t gl_int64_t 196 # define GL_INT64_T 197 # endif 198 # endif 199 200 # ifdef UINT64_MAX 201 # define GL_UINT64_T 202 # else 203 # if ULONG_MAX >> 31 >> 31 >> 1 == 1 204 # undef uint64_t 205 typedef unsigned long int gl_uint64_t; 206 # define uint64_t gl_uint64_t 207 # define GL_UINT64_T 208 # elif defined _MSC_VER 209 # undef uint64_t 210 typedef unsigned __int64 gl_uint64_t; 211 # define uint64_t gl_uint64_t 212 # define GL_UINT64_T 213 # else 214 # undef uint64_t 215 typedef unsigned long long int gl_uint64_t; 216 # define uint64_t gl_uint64_t 217 # define GL_UINT64_T 218 # endif 219 # endif 220 221 /* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */ 222 # define _UINT8_T 223 # define _UINT32_T 224 # define _UINT64_T 225 226 227 /* 7.18.1.2. Minimum-width integer types */ 228 229 /* Here we assume a standard architecture where the hardware integer 230 types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types 231 are the same as the corresponding N_t types. */ 232 233 # undef int_least8_t 234 # undef uint_least8_t 235 # undef int_least16_t 236 # undef uint_least16_t 237 # undef int_least32_t 238 # undef uint_least32_t 239 # undef int_least64_t 240 # undef uint_least64_t 241 # define int_least8_t int8_t 242 # define uint_least8_t uint8_t 243 # define int_least16_t int16_t 244 # define uint_least16_t uint16_t 245 # define int_least32_t int32_t 246 # define uint_least32_t uint32_t 247 # ifdef GL_INT64_T 248 # define int_least64_t int64_t 249 # endif 250 # ifdef GL_UINT64_T 251 # define uint_least64_t uint64_t 252 # endif 253 254 /* 7.18.1.3. Fastest minimum-width integer types */ 255 256 /* Note: Other <stdint.h> substitutes may define these types differently. 257 It is not recommended to use these types in public header files. */ 258 259 /* Here we assume a standard architecture where the hardware integer 260 types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types 261 are taken from the same list of types. The following code normally 262 uses types consistent with glibc, as that lessens the chance of 263 incompatibility with older GNU hosts. */ 264 265 # undef int_fast8_t 266 # undef uint_fast8_t 267 # undef int_fast16_t 268 # undef uint_fast16_t 269 # undef int_fast32_t 270 # undef uint_fast32_t 271 # undef int_fast64_t 272 # undef uint_fast64_t 273 typedef signed char gl_int_fast8_t; 274 typedef unsigned char gl_uint_fast8_t; 275 276 # ifdef __sun 277 /* Define types compatible with SunOS 5.10, so that code compiled under 278 earlier SunOS versions works with code compiled under SunOS 5.10. */ 279 typedef int gl_int_fast32_t; 280 typedef unsigned int gl_uint_fast32_t; 281 # else 282 typedef long int gl_int_fast32_t; 283 typedef unsigned long int gl_uint_fast32_t; 284 # endif 285 typedef gl_int_fast32_t gl_int_fast16_t; 286 typedef gl_uint_fast32_t gl_uint_fast16_t; 287 288 # define int_fast8_t gl_int_fast8_t 289 # define uint_fast8_t gl_uint_fast8_t 290 # define int_fast16_t gl_int_fast16_t 291 # define uint_fast16_t gl_uint_fast16_t 292 # define int_fast32_t gl_int_fast32_t 293 # define uint_fast32_t gl_uint_fast32_t 294 # ifdef GL_INT64_T 295 # define int_fast64_t int64_t 296 # endif 297 # ifdef GL_UINT64_T 298 # define uint_fast64_t uint64_t 299 # endif 300 301 /* 7.18.1.4. Integer types capable of holding object pointers */ 302 303 /* kLIBC's <stdint.h> defines _INTPTR_T_DECLARED and needs its own 304 definitions of intptr_t and uintptr_t (which use int and unsigned) 305 to avoid clashes with declarations of system functions like sbrk. 306 Similarly, MinGW WSL-5.4.1 <stdint.h> needs its own intptr_t and 307 uintptr_t to avoid conflicting declarations of system functions like 308 _findclose in <io.h>. */ 309 # if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \ 310 || defined __MINGW32__) 311 # undef intptr_t 312 # undef uintptr_t 313 # ifdef _WIN64 314 typedef long long int gl_intptr_t; 315 typedef unsigned long long int gl_uintptr_t; 316 # else 317 typedef long int gl_intptr_t; 318 typedef unsigned long int gl_uintptr_t; 319 # endif 320 # define intptr_t gl_intptr_t 321 # define uintptr_t gl_uintptr_t 322 # endif 323 324 /* 7.18.1.5. Greatest-width integer types */ 325 326 /* Note: These types are compiler dependent. It may be unwise to use them in 327 public header files. */ 328 329 /* If the system defines INTMAX_MAX, assume that intmax_t works, and 330 similarly for UINTMAX_MAX and uintmax_t. This avoids problems with 331 assuming one type where another is used by the system. */ 332 333 # ifndef INTMAX_MAX 334 # undef INTMAX_C 335 # undef intmax_t 336 # if LONG_MAX >> 30 == 1 337 typedef long long int gl_intmax_t; 338 # define intmax_t gl_intmax_t 339 # elif defined GL_INT64_T 340 # define intmax_t int64_t 341 # else 342 typedef long int gl_intmax_t; 343 # define intmax_t gl_intmax_t 344 # endif 345 # endif 346 347 # ifndef UINTMAX_MAX 348 # undef UINTMAX_C 349 # undef uintmax_t 350 # if ULONG_MAX >> 31 == 1 351 typedef unsigned long long int gl_uintmax_t; 352 # define uintmax_t gl_uintmax_t 353 # elif defined GL_UINT64_T 354 # define uintmax_t uint64_t 355 # else 356 typedef unsigned long int gl_uintmax_t; 357 # define uintmax_t gl_uintmax_t 358 # endif 359 # endif 360 361 /* Verify that intmax_t and uintmax_t have the same size. Too much code 362 breaks if this is not the case. If this check fails, the reason is likely 363 to be found in the autoconf macros. */ 364 typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) 365 ? 1 : -1]; 366 367 # define GNULIB_defined_stdint_types 1 368 # endif /* !GNULIB_defined_stdint_types */ 369 370 /* 7.18.2. Limits of specified-width integer types */ 371 372 /* 7.18.2.1. Limits of exact-width integer types */ 373 374 /* Here we assume a standard architecture where the hardware integer 375 types have 8, 16, 32, optionally 64 bits. */ 376 377 # undef INT8_MIN 378 # undef INT8_MAX 379 # undef UINT8_MAX 380 # define INT8_MIN (~ INT8_MAX) 381 # define INT8_MAX 127 382 # define UINT8_MAX 255 383 384 # undef INT16_MIN 385 # undef INT16_MAX 386 # undef UINT16_MAX 387 # define INT16_MIN (~ INT16_MAX) 388 # define INT16_MAX 32767 389 # define UINT16_MAX 65535 390 391 # undef INT32_MIN 392 # undef INT32_MAX 393 # undef UINT32_MAX 394 # define INT32_MIN (~ INT32_MAX) 395 # define INT32_MAX 2147483647 396 # define UINT32_MAX 4294967295U 397 398 # if defined GL_INT64_T && ! defined INT64_MAX 399 /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 400 evaluates the latter incorrectly in preprocessor expressions. */ 401 # define INT64_MIN (- INTMAX_C (1) << 63) 402 # define INT64_MAX INTMAX_C (9223372036854775807) 403 # endif 404 405 # if defined GL_UINT64_T && ! defined UINT64_MAX 406 # define UINT64_MAX UINTMAX_C (18446744073709551615) 407 # endif 408 409 /* 7.18.2.2. Limits of minimum-width integer types */ 410 411 /* Here we assume a standard architecture where the hardware integer 412 types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types 413 are the same as the corresponding N_t types. */ 414 415 # undef INT_LEAST8_MIN 416 # undef INT_LEAST8_MAX 417 # undef UINT_LEAST8_MAX 418 # define INT_LEAST8_MIN INT8_MIN 419 # define INT_LEAST8_MAX INT8_MAX 420 # define UINT_LEAST8_MAX UINT8_MAX 421 422 # undef INT_LEAST16_MIN 423 # undef INT_LEAST16_MAX 424 # undef UINT_LEAST16_MAX 425 # define INT_LEAST16_MIN INT16_MIN 426 # define INT_LEAST16_MAX INT16_MAX 427 # define UINT_LEAST16_MAX UINT16_MAX 428 429 # undef INT_LEAST32_MIN 430 # undef INT_LEAST32_MAX 431 # undef UINT_LEAST32_MAX 432 # define INT_LEAST32_MIN INT32_MIN 433 # define INT_LEAST32_MAX INT32_MAX 434 # define UINT_LEAST32_MAX UINT32_MAX 435 436 # undef INT_LEAST64_MIN 437 # undef INT_LEAST64_MAX 438 # ifdef GL_INT64_T 439 # define INT_LEAST64_MIN INT64_MIN 440 # define INT_LEAST64_MAX INT64_MAX 441 # endif 442 443 # undef UINT_LEAST64_MAX 444 # ifdef GL_UINT64_T 445 # define UINT_LEAST64_MAX UINT64_MAX 446 # endif 447 448 /* 7.18.2.3. Limits of fastest minimum-width integer types */ 449 450 /* Here we assume a standard architecture where the hardware integer 451 types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types 452 are taken from the same list of types. */ 453 454 # undef INT_FAST8_MIN 455 # undef INT_FAST8_MAX 456 # undef UINT_FAST8_MAX 457 # define INT_FAST8_MIN SCHAR_MIN 458 # define INT_FAST8_MAX SCHAR_MAX 459 # define UINT_FAST8_MAX UCHAR_MAX 460 461 # undef INT_FAST16_MIN 462 # undef INT_FAST16_MAX 463 # undef UINT_FAST16_MAX 464 # define INT_FAST16_MIN INT_FAST32_MIN 465 # define INT_FAST16_MAX INT_FAST32_MAX 466 # define UINT_FAST16_MAX UINT_FAST32_MAX 467 468 # undef INT_FAST32_MIN 469 # undef INT_FAST32_MAX 470 # undef UINT_FAST32_MAX 471 # ifdef __sun 472 # define INT_FAST32_MIN INT_MIN 473 # define INT_FAST32_MAX INT_MAX 474 # define UINT_FAST32_MAX UINT_MAX 475 # else 476 # define INT_FAST32_MIN LONG_MIN 477 # define INT_FAST32_MAX LONG_MAX 478 # define UINT_FAST32_MAX ULONG_MAX 479 # endif 480 481 # undef INT_FAST64_MIN 482 # undef INT_FAST64_MAX 483 # ifdef GL_INT64_T 484 # define INT_FAST64_MIN INT64_MIN 485 # define INT_FAST64_MAX INT64_MAX 486 # endif 487 488 # undef UINT_FAST64_MAX 489 # ifdef GL_UINT64_T 490 # define UINT_FAST64_MAX UINT64_MAX 491 # endif 492 493 /* 7.18.2.4. Limits of integer types capable of holding object pointers */ 494 495 # undef INTPTR_MIN 496 # undef INTPTR_MAX 497 # undef UINTPTR_MAX 498 # ifdef _WIN64 499 # define INTPTR_MIN LLONG_MIN 500 # define INTPTR_MAX LLONG_MAX 501 # define UINTPTR_MAX ULLONG_MAX 502 # else 503 # define INTPTR_MIN LONG_MIN 504 # define INTPTR_MAX LONG_MAX 505 # define UINTPTR_MAX ULONG_MAX 506 # endif 507 508 /* 7.18.2.5. Limits of greatest-width integer types */ 509 510 # ifndef INTMAX_MAX 511 # undef INTMAX_MIN 512 # ifdef INT64_MAX 513 # define INTMAX_MIN INT64_MIN 514 # define INTMAX_MAX INT64_MAX 515 # else 516 # define INTMAX_MIN INT32_MIN 517 # define INTMAX_MAX INT32_MAX 518 # endif 519 # endif 520 521 # ifndef UINTMAX_MAX 522 # ifdef UINT64_MAX 523 # define UINTMAX_MAX UINT64_MAX 524 # else 525 # define UINTMAX_MAX UINT32_MAX 526 # endif 527 # endif 528 529 /* 7.18.3. Limits of other integer types */ 530 531 /* ptrdiff_t limits */ 532 # undef PTRDIFF_MIN 533 # undef PTRDIFF_MAX 534 # if 0 535 # ifdef _LP64 536 # define PTRDIFF_MIN _STDINT_SIGNED_MIN (64, 0l) 537 # define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) 538 # else 539 # define PTRDIFF_MIN _STDINT_SIGNED_MIN (32, 0) 540 # define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) 541 # endif 542 # else 543 # define PTRDIFF_MIN \ 544 _STDINT_SIGNED_MIN (, 0) 545 # define PTRDIFF_MAX \ 546 _STDINT_MAX (1, , 0) 547 # endif 548 549 /* sig_atomic_t limits */ 550 # undef SIG_ATOMIC_MIN 551 # undef SIG_ATOMIC_MAX 552 # if 553 # define SIG_ATOMIC_MIN \ 554 _STDINT_SIGNED_MIN (, 0) 555 # else 556 # define SIG_ATOMIC_MIN \ 557 _STDINT_UNSIGNED_MIN (, 0) 558 # endif 559 # define SIG_ATOMIC_MAX \ 560 _STDINT_MAX (, , \ 561 0) 562 563 564 /* size_t limit */ 565 # undef SIZE_MAX 566 # if 0 567 # ifdef _LP64 568 # define SIZE_MAX _STDINT_MAX (0, 64, 0ul) 569 # else 570 # define SIZE_MAX _STDINT_MAX (0, 32, 0ul) 571 # endif 572 # else 573 # define SIZE_MAX _STDINT_MAX (0, , 0) 574 # endif 575 576 /* wchar_t limits */ 577 /* Get WCHAR_MIN, WCHAR_MAX. 578 This include is not on the top, above, because on OSF/1 4.0 we have a 579 sequence of nested includes 580 <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes 581 <stdint.h> and assumes its types are already defined. */ 582 # if 1 && ! (defined WCHAR_MIN && defined WCHAR_MAX) 583 # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H 584 # include <wchar.h> 585 # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H 586 # endif 587 # undef WCHAR_MIN 588 # undef WCHAR_MAX 589 # if 590 # define WCHAR_MIN \ 591 _STDINT_SIGNED_MIN (, 0) 592 # else 593 # define WCHAR_MIN \ 594 _STDINT_UNSIGNED_MIN (, 0) 595 # endif 596 # define WCHAR_MAX \ 597 _STDINT_MAX (, , 0) 598 599 /* wint_t limits */ 600 /* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, is not 601 accurate, therefore use the definitions from above. */ 602 # if !0 603 # undef WINT_MIN 604 # undef WINT_MAX 605 # if 606 # define WINT_MIN \ 607 _STDINT_SIGNED_MIN (, 0) 608 # else 609 # define WINT_MIN \ 610 _STDINT_UNSIGNED_MIN (, 0) 611 # endif 612 # define WINT_MAX \ 613 _STDINT_MAX (, , 0) 614 # endif 615 616 /* 7.18.4. Macros for integer constants */ 617 618 /* 7.18.4.1. Macros for minimum-width integer constants */ 619 /* According to ISO C 99 Technical Corrigendum 1 */ 620 621 /* Here we assume a standard architecture where the hardware integer 622 types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ 623 624 # undef INT8_C 625 # undef UINT8_C 626 # define INT8_C(x) x 627 # define UINT8_C(x) x 628 629 # undef INT16_C 630 # undef UINT16_C 631 # define INT16_C(x) x 632 # define UINT16_C(x) x 633 634 # undef INT32_C 635 # undef UINT32_C 636 # define INT32_C(x) x 637 # define UINT32_C(x) x ## U 638 639 # undef INT64_C 640 # undef UINT64_C 641 # if LONG_MAX >> 31 >> 31 == 1 642 # define INT64_C(x) x##L 643 # elif defined _MSC_VER 644 # define INT64_C(x) x##i64 645 # else 646 # define INT64_C(x) x##LL 647 # endif 648 # if ULONG_MAX >> 31 >> 31 >> 1 == 1 649 # define UINT64_C(x) x##UL 650 # elif defined _MSC_VER 651 # define UINT64_C(x) x##ui64 652 # else 653 # define UINT64_C(x) x##ULL 654 # endif 655 656 /* 7.18.4.2. Macros for greatest-width integer constants */ 657 658 # ifndef INTMAX_C 659 # if LONG_MAX >> 30 == 1 660 # define INTMAX_C(x) x##LL 661 # elif defined GL_INT64_T 662 # define INTMAX_C(x) INT64_C(x) 663 # else 664 # define INTMAX_C(x) x##L 665 # endif 666 # endif 667 668 # ifndef UINTMAX_C 669 # if ULONG_MAX >> 31 == 1 670 # define UINTMAX_C(x) x##ULL 671 # elif defined GL_UINT64_T 672 # define UINTMAX_C(x) UINT64_C(x) 673 # else 674 # define UINTMAX_C(x) x##UL 675 # endif 676 # endif 677 678 #endif /* !1 */ 679 680 /* Macros specified by ISO/IEC TS 18661-1:2014. */ 681 682 #if (!defined UINTMAX_WIDTH \ 683 && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) 684 # ifdef INT8_MAX 685 # define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX) 686 # endif 687 # ifdef UINT8_MAX 688 # define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX) 689 # endif 690 # ifdef INT16_MAX 691 # define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX) 692 # endif 693 # ifdef UINT16_MAX 694 # define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX) 695 # endif 696 # ifdef INT32_MAX 697 # define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX) 698 # endif 699 # ifdef UINT32_MAX 700 # define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX) 701 # endif 702 # ifdef INT64_MAX 703 # define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX) 704 # endif 705 # ifdef UINT64_MAX 706 # define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX) 707 # endif 708 # define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX) 709 # define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX) 710 # define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX) 711 # define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX) 712 # define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX) 713 # define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX) 714 # define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX) 715 # define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX) 716 # define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX) 717 # define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX) 718 # define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX) 719 # define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX) 720 # define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX) 721 # define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX) 722 # define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX) 723 # define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX) 724 # define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX) 725 # define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX) 726 # define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX) 727 # define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX) 728 # define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX) 729 # define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX) 730 # define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX) 731 # ifdef WINT_MAX 732 # define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX) 733 # endif 734 # ifdef SIG_ATOMIC_MAX 735 # define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX) 736 # endif 737 #endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ 738 739 #endif /* _GL_STDINT_H */ 740 #endif /* !(defined __ANDROID__ && ...) */ 741 #endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ 742