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