idn-int.h (22291B)
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 2 /* Copyright (C) 2001-2002, 2004-2024 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 file is free software: you can redistribute it and/or modify 7 it under the terms of the GNU Lesser General Public License as 8 published by the Free Software Foundation; either version 2.1 of the 9 License, or (at your option) any later version. 10 11 This file 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 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser 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_LGL_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 <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_LGL_STDINT_H is defined. 76 The include requires a split double-inclusion guard. */ 77 # include <stdint.h> 78 #endif 79 80 #if ! defined _GL_LGL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H 81 #define _GL_LGL_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 ! 0 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 __INTPTR_WIDTH__ \ 311 && __INTPTR_WIDTH__ != (defined _WIN64 ? LLONG_WIDTH : LONG_WIDTH)) \ 312 || defined __MINGW32__) 313 # undef intptr_t 314 # undef uintptr_t 315 # ifdef _WIN64 316 typedef long long int gl_intptr_t; 317 typedef unsigned long long int gl_uintptr_t; 318 # else 319 typedef long int gl_intptr_t; 320 typedef unsigned long int gl_uintptr_t; 321 # endif 322 # define intptr_t gl_intptr_t 323 # define uintptr_t gl_uintptr_t 324 # endif 325 326 /* 7.18.1.5. Greatest-width integer types */ 327 328 /* Note: These types are compiler dependent. It may be unwise to use them in 329 public header files. */ 330 331 /* If the system defines INTMAX_MAX, assume that intmax_t works, and 332 similarly for UINTMAX_MAX and uintmax_t. This avoids problems with 333 assuming one type where another is used by the system. */ 334 335 # ifndef INTMAX_MAX 336 # undef INTMAX_C 337 # undef intmax_t 338 # if LONG_MAX >> 30 == 1 339 typedef long long int gl_intmax_t; 340 # define intmax_t gl_intmax_t 341 # elif defined GL_INT64_T 342 # define intmax_t int64_t 343 # else 344 typedef long int gl_intmax_t; 345 # define intmax_t gl_intmax_t 346 # endif 347 # endif 348 349 # ifndef UINTMAX_MAX 350 # undef UINTMAX_C 351 # undef uintmax_t 352 # if ULONG_MAX >> 31 == 1 353 typedef unsigned long long int gl_uintmax_t; 354 # define uintmax_t gl_uintmax_t 355 # elif defined GL_UINT64_T 356 # define uintmax_t uint64_t 357 # else 358 typedef unsigned long int gl_uintmax_t; 359 # define uintmax_t gl_uintmax_t 360 # endif 361 # endif 362 363 /* Verify that intmax_t and uintmax_t have the same size. Too much code 364 breaks if this is not the case. If this check fails, the reason is likely 365 to be found in the autoconf macros. */ 366 typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) 367 ? 1 : -1]; 368 369 # define GNULIB_defined_stdint_types 1 370 # endif /* !GNULIB_defined_stdint_types */ 371 372 /* 7.18.2. Limits of specified-width integer types */ 373 374 /* 7.18.2.1. Limits of exact-width integer types */ 375 376 /* Here we assume a standard architecture where the hardware integer 377 types have 8, 16, 32, optionally 64 bits. */ 378 379 # undef INT8_MIN 380 # undef INT8_MAX 381 # undef UINT8_MAX 382 # define INT8_MIN (~ INT8_MAX) 383 # define INT8_MAX 127 384 # define UINT8_MAX 255 385 386 # undef INT16_MIN 387 # undef INT16_MAX 388 # undef UINT16_MAX 389 # define INT16_MIN (~ INT16_MAX) 390 # define INT16_MAX 32767 391 # define UINT16_MAX 65535 392 393 # undef INT32_MIN 394 # undef INT32_MAX 395 # undef UINT32_MAX 396 # define INT32_MIN (~ INT32_MAX) 397 # define INT32_MAX 2147483647 398 # define UINT32_MAX 4294967295U 399 400 # if defined GL_INT64_T && ! defined INT64_MAX 401 /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 402 evaluates the latter incorrectly in preprocessor expressions. */ 403 # define INT64_MIN (- INTMAX_C (1) << 63) 404 # define INT64_MAX INTMAX_C (9223372036854775807) 405 # endif 406 407 # if defined GL_UINT64_T && ! defined UINT64_MAX 408 # define UINT64_MAX UINTMAX_C (18446744073709551615) 409 # endif 410 411 /* 7.18.2.2. Limits of minimum-width integer types */ 412 413 /* Here we assume a standard architecture where the hardware integer 414 types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types 415 are the same as the corresponding N_t types. */ 416 417 # undef INT_LEAST8_MIN 418 # undef INT_LEAST8_MAX 419 # undef UINT_LEAST8_MAX 420 # define INT_LEAST8_MIN INT8_MIN 421 # define INT_LEAST8_MAX INT8_MAX 422 # define UINT_LEAST8_MAX UINT8_MAX 423 424 # undef INT_LEAST16_MIN 425 # undef INT_LEAST16_MAX 426 # undef UINT_LEAST16_MAX 427 # define INT_LEAST16_MIN INT16_MIN 428 # define INT_LEAST16_MAX INT16_MAX 429 # define UINT_LEAST16_MAX UINT16_MAX 430 431 # undef INT_LEAST32_MIN 432 # undef INT_LEAST32_MAX 433 # undef UINT_LEAST32_MAX 434 # define INT_LEAST32_MIN INT32_MIN 435 # define INT_LEAST32_MAX INT32_MAX 436 # define UINT_LEAST32_MAX UINT32_MAX 437 438 # undef INT_LEAST64_MIN 439 # undef INT_LEAST64_MAX 440 # ifdef GL_INT64_T 441 # define INT_LEAST64_MIN INT64_MIN 442 # define INT_LEAST64_MAX INT64_MAX 443 # endif 444 445 # undef UINT_LEAST64_MAX 446 # ifdef GL_UINT64_T 447 # define UINT_LEAST64_MAX UINT64_MAX 448 # endif 449 450 /* 7.18.2.3. Limits of fastest minimum-width integer types */ 451 452 /* Here we assume a standard architecture where the hardware integer 453 types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types 454 are taken from the same list of types. */ 455 456 # undef INT_FAST8_MIN 457 # undef INT_FAST8_MAX 458 # undef UINT_FAST8_MAX 459 # define INT_FAST8_MIN SCHAR_MIN 460 # define INT_FAST8_MAX SCHAR_MAX 461 # define UINT_FAST8_MAX UCHAR_MAX 462 463 # undef INT_FAST16_MIN 464 # undef INT_FAST16_MAX 465 # undef UINT_FAST16_MAX 466 # define INT_FAST16_MIN INT_FAST32_MIN 467 # define INT_FAST16_MAX INT_FAST32_MAX 468 # define UINT_FAST16_MAX UINT_FAST32_MAX 469 470 # undef INT_FAST32_MIN 471 # undef INT_FAST32_MAX 472 # undef UINT_FAST32_MAX 473 # ifdef __sun 474 # define INT_FAST32_MIN INT_MIN 475 # define INT_FAST32_MAX INT_MAX 476 # define UINT_FAST32_MAX UINT_MAX 477 # else 478 # define INT_FAST32_MIN LONG_MIN 479 # define INT_FAST32_MAX LONG_MAX 480 # define UINT_FAST32_MAX ULONG_MAX 481 # endif 482 483 # undef INT_FAST64_MIN 484 # undef INT_FAST64_MAX 485 # ifdef GL_INT64_T 486 # define INT_FAST64_MIN INT64_MIN 487 # define INT_FAST64_MAX INT64_MAX 488 # endif 489 490 # undef UINT_FAST64_MAX 491 # ifdef GL_UINT64_T 492 # define UINT_FAST64_MAX UINT64_MAX 493 # endif 494 495 /* 7.18.2.4. Limits of integer types capable of holding object pointers */ 496 497 # undef INTPTR_MIN 498 # undef INTPTR_MAX 499 # undef UINTPTR_MAX 500 # ifdef _WIN64 501 # define INTPTR_MIN LLONG_MIN 502 # define INTPTR_MAX LLONG_MAX 503 # define UINTPTR_MAX ULLONG_MAX 504 # else 505 # define INTPTR_MIN LONG_MIN 506 # define INTPTR_MAX LONG_MAX 507 # define UINTPTR_MAX ULONG_MAX 508 # endif 509 510 /* 7.18.2.5. Limits of greatest-width integer types */ 511 512 # ifndef INTMAX_MAX 513 # undef INTMAX_MIN 514 # ifdef INT64_MAX 515 # define INTMAX_MIN INT64_MIN 516 # define INTMAX_MAX INT64_MAX 517 # else 518 # define INTMAX_MIN INT32_MIN 519 # define INTMAX_MAX INT32_MAX 520 # endif 521 # endif 522 523 # ifndef UINTMAX_MAX 524 # ifdef UINT64_MAX 525 # define UINTMAX_MAX UINT64_MAX 526 # else 527 # define UINTMAX_MAX UINT32_MAX 528 # endif 529 # endif 530 531 /* 7.18.3. Limits of other integer types */ 532 533 /* ptrdiff_t limits */ 534 # undef PTRDIFF_MIN 535 # undef PTRDIFF_MAX 536 # if 0 537 # ifdef _LP64 538 # define PTRDIFF_MIN _STDINT_SIGNED_MIN (64, 0l) 539 # define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) 540 # else 541 # define PTRDIFF_MIN _STDINT_SIGNED_MIN (32, 0) 542 # define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) 543 # endif 544 # else 545 # define PTRDIFF_MIN \ 546 _STDINT_SIGNED_MIN (64, 0l) 547 # define PTRDIFF_MAX \ 548 _STDINT_MAX (1, 64, 0l) 549 # endif 550 551 /* sig_atomic_t limits */ 552 # undef SIG_ATOMIC_MIN 553 # undef SIG_ATOMIC_MAX 554 # if 1 555 # define SIG_ATOMIC_MIN \ 556 _STDINT_SIGNED_MIN (32, 0) 557 # else 558 # define SIG_ATOMIC_MIN \ 559 _STDINT_UNSIGNED_MIN (32, 0) 560 # endif 561 # define SIG_ATOMIC_MAX \ 562 _STDINT_MAX (1, 32, \ 563 0) 564 565 566 /* size_t limit */ 567 # undef SIZE_MAX 568 # if 0 569 # ifdef _LP64 570 # define SIZE_MAX _STDINT_MAX (0, 64, 0ul) 571 # else 572 # define SIZE_MAX _STDINT_MAX (0, 32, 0ul) 573 # endif 574 # else 575 # define SIZE_MAX _STDINT_MAX (0, 64, 0ul) 576 # endif 577 578 /* wchar_t limits */ 579 /* Get WCHAR_MIN, WCHAR_MAX. 580 This include is not on the top, above, because on OSF/1 4.0 we have a 581 sequence of nested includes 582 <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes 583 <stdint.h> and assumes its types are already defined. */ 584 # if 1 && ! (defined WCHAR_MIN && defined WCHAR_MAX) 585 # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H 586 # include <wchar.h> 587 # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H 588 # endif 589 # undef WCHAR_MIN 590 # undef WCHAR_MAX 591 # if 0 592 # define WCHAR_MIN \ 593 _STDINT_SIGNED_MIN (32, 0u) 594 # else 595 # define WCHAR_MIN \ 596 _STDINT_UNSIGNED_MIN (32, 0u) 597 # endif 598 # define WCHAR_MAX \ 599 _STDINT_MAX (0, 32, 0u) 600 601 /* wint_t limits */ 602 /* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, u is not 603 accurate, therefore use the definitions from above. */ 604 # if !0 605 # undef WINT_MIN 606 # undef WINT_MAX 607 # if 0 608 # define WINT_MIN \ 609 _STDINT_SIGNED_MIN (32, 0u) 610 # else 611 # define WINT_MIN \ 612 _STDINT_UNSIGNED_MIN (32, 0u) 613 # endif 614 # define WINT_MAX \ 615 _STDINT_MAX (0, 32, 0u) 616 # endif 617 618 /* 7.18.4. Macros for integer constants */ 619 620 /* 7.18.4.1. Macros for minimum-width integer constants */ 621 /* According to ISO C 99 Technical Corrigendum 1 */ 622 623 /* Here we assume a standard architecture where the hardware integer 624 types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ 625 626 # undef INT8_C 627 # undef UINT8_C 628 # define INT8_C(x) x 629 # define UINT8_C(x) x 630 631 # undef INT16_C 632 # undef UINT16_C 633 # define INT16_C(x) x 634 # define UINT16_C(x) x 635 636 # undef INT32_C 637 # undef UINT32_C 638 # define INT32_C(x) x 639 # define UINT32_C(x) x ## U 640 641 # undef INT64_C 642 # undef UINT64_C 643 # if LONG_MAX >> 31 >> 31 == 1 644 # define INT64_C(x) x##L 645 # elif defined _MSC_VER 646 # define INT64_C(x) x##i64 647 # else 648 # define INT64_C(x) x##LL 649 # endif 650 # if ULONG_MAX >> 31 >> 31 >> 1 == 1 651 # define UINT64_C(x) x##UL 652 # elif defined _MSC_VER 653 # define UINT64_C(x) x##ui64 654 # else 655 # define UINT64_C(x) x##ULL 656 # endif 657 658 /* 7.18.4.2. Macros for greatest-width integer constants */ 659 660 # ifndef INTMAX_C 661 # if LONG_MAX >> 30 == 1 662 # define INTMAX_C(x) x##LL 663 # elif defined GL_INT64_T 664 # define INTMAX_C(x) INT64_C(x) 665 # else 666 # define INTMAX_C(x) x##L 667 # endif 668 # endif 669 670 # ifndef UINTMAX_C 671 # if ULONG_MAX >> 31 == 1 672 # define UINTMAX_C(x) x##ULL 673 # elif defined GL_UINT64_T 674 # define UINTMAX_C(x) UINT64_C(x) 675 # else 676 # define UINTMAX_C(x) x##UL 677 # endif 678 # endif 679 680 #endif /* !0 */ 681 682 /* Macros specified by ISO/IEC TS 18661-1:2014. */ 683 684 #if (!defined UINTMAX_WIDTH \ 685 && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) 686 # ifdef INT8_MAX 687 # define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX) 688 # endif 689 # ifdef UINT8_MAX 690 # define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX) 691 # endif 692 # ifdef INT16_MAX 693 # define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX) 694 # endif 695 # ifdef UINT16_MAX 696 # define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX) 697 # endif 698 # ifdef INT32_MAX 699 # define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX) 700 # endif 701 # ifdef UINT32_MAX 702 # define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX) 703 # endif 704 # ifdef INT64_MAX 705 # define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX) 706 # endif 707 # ifdef UINT64_MAX 708 # define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX) 709 # endif 710 # define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX) 711 # define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX) 712 # define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX) 713 # define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX) 714 # define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX) 715 # define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX) 716 # define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX) 717 # define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX) 718 # define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX) 719 # define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX) 720 # define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX) 721 # define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX) 722 # define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX) 723 # define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX) 724 # define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX) 725 # define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX) 726 # define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX) 727 # define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX) 728 # define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX) 729 # define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX) 730 # define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX) 731 # define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX) 732 # define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX) 733 # ifdef WINT_MAX 734 # define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX) 735 # endif 736 # ifdef SIG_ATOMIC_MAX 737 # define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX) 738 # endif 739 #endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ 740 741 #endif /* _GL_LGL_STDINT_H */ 742 #endif /* !(defined __ANDROID__ && ...) */ 743 #endif /* !defined _GL_LGL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */