/* Copyright (C) 2001-2002, 2004-2010 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/*
* ISO C 99 <stdint.h> for platforms that lack it.
*/
#ifndef _GL_STDINT_H
#if __GNUC__ >= 3
#endif
/* When including a system file that in turn includes <inttypes.h>,
use the system <inttypes.h>, not our substitute. This avoids
<inttypes.h>. */
/* Get those types that are already defined in other system include
files, so that we can "#define int8_t signed char" below without
worrying about a later system include file containing a "typedef
signed char int8_t;" that will get messed up by our macro. Our
macros should all be consistent with the system versions, except
for the "fast" types and macros, which we recommend against using
in public interfaces due to compiler differences. */
#if @HAVE_STDINT_H@
/* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users
with "This header file is to be used only for c99 mode compilations"
diagnostics. */
# define __STDINT_H__
# endif
/* Other systems may have an incomplete or buggy <stdint.h>.
Include it before <inttypes.h>, since any "#include <stdint.h>"
in <inttypes.h> would reinclude us, skipping our contents because
_GL_STDINT_H is defined.
The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_STDINT_H@
#endif
#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
#define _GL_STDINT_H
relies on the system <stdint.h> definitions, so include
#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
#endif
/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */
#include <limits.h>
#if @HAVE_INTTYPES_H@
/* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
<inttypes.h> also defines intptr_t and uintptr_t. */
# include <inttypes.h>
/* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */
# include <sys/inttypes.h>
#endif
#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
#endif
/* Minimum and maximum values for a integer type under the usual assumption.
Return an unspecified value if BITS == 0, adding a check to pacify
picky compilers. */
((signed) \
: /* The expression for the unsigned case. The subtraction of (signed) \
is a nop in the unsigned case and avoids "signed integer overflow" \
warnings in the signed case. */ \
/* 7.18.1.1. Exact-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. */
typedef signed char gl_int8_t;
typedef unsigned char gl_uint8_t;
typedef short int gl_int16_t;
typedef unsigned short int gl_uint16_t;
typedef int gl_int32_t;
typedef unsigned int gl_uint32_t;
/* Do not undefine int64_t if gnulib is not being used with 64-bit
typedef long int gl_int64_t;
# define GL_INT64_T
# define GL_INT64_T
typedef long long int gl_int64_t;
# define GL_INT64_T
#endif
typedef unsigned long int gl_uint64_t;
# define GL_UINT64_T
# define GL_UINT64_T
typedef unsigned long long int gl_uint64_t;
# define GL_UINT64_T
#endif
/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
#define _UINT8_T
#define _UINT32_T
#define _UINT64_T
/* 7.18.1.2. Minimum-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
are the same as the corresponding N_t types. */
#ifdef GL_INT64_T
#endif
#ifdef GL_UINT64_T
#endif
/* 7.18.1.3. Fastest minimum-width integer types */
/* Note: Other <stdint.h> substitutes may define these types differently.
It is not recommended to use these types in public header files. */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
are taken from the same list of types. Assume that 'long int'
is fast enough for all narrower integers. */
typedef long int gl_int_fast8_t;
typedef unsigned long int gl_uint_fast8_t;
typedef long int gl_int_fast16_t;
typedef unsigned long int gl_uint_fast16_t;
typedef long int gl_int_fast32_t;
typedef unsigned long int gl_uint_fast32_t;
#ifdef GL_INT64_T
#endif
#ifdef GL_UINT64_T
#endif
/* 7.18.1.4. Integer types capable of holding object pointers */
typedef long int gl_intptr_t;
typedef unsigned long int gl_uintptr_t;
/* 7.18.1.5. Greatest-width integer types */
/* Note: These types are compiler dependent. It may be unwise to use them in
public header files. */
typedef long long int gl_intmax_t;
#elif defined GL_INT64_T
#else
typedef long int gl_intmax_t;
#endif
typedef unsigned long long int gl_uintmax_t;
#elif defined GL_UINT64_T
#else
typedef unsigned long int gl_uintmax_t;
#endif
/* Verify that intmax_t and uintmax_t have the same size. Too much code
breaks if this is not the case. If this check fails, the reason is likely
to be found in the autoconf macros. */
/* 7.18.2. Limits of specified-width integer types */
#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
/* 7.18.2.1. Limits of exact-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. */
#ifdef GL_INT64_T
/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
evaluates the latter incorrectly in preprocessor expressions. */
#endif
#ifdef GL_UINT64_T
#endif
/* 7.18.2.2. Limits of minimum-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
are the same as the corresponding N_t types. */
#ifdef GL_INT64_T
#endif
#ifdef GL_UINT64_T
#endif
/* 7.18.2.3. Limits of fastest minimum-width integer types */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
are taken from the same list of types. */
#ifdef GL_INT64_T
#endif
#ifdef GL_UINT64_T
#endif
/* 7.18.2.4. Limits of integer types capable of holding object pointers */
/* 7.18.2.5. Limits of greatest-width integer types */
#ifdef INT64_MAX
#else
#endif
#ifdef UINT64_MAX
#else
#endif
/* 7.18.3. Limits of other integer types */
/* ptrdiff_t limits */
#if @APPLE_UNIVERSAL_BUILD@
# ifdef _LP64
# else
# endif
#else
# define PTRDIFF_MIN \
# define PTRDIFF_MAX \
#endif
/* sig_atomic_t limits */
#define SIG_ATOMIC_MIN \
#define SIG_ATOMIC_MAX \
/* size_t limit */
#if @APPLE_UNIVERSAL_BUILD@
# ifdef _LP64
# else
# endif
#else
#endif
/* wchar_t limits */
/* Get WCHAR_MIN, WCHAR_MAX.
This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested
<stdint.h> and assumes its types are already defined. */
# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
# include <wchar.h>
#endif
#define WCHAR_MIN \
#define WCHAR_MAX \
/* wint_t limits */
#define WINT_MIN \
#define WINT_MAX \
#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
/* 7.18.4. Macros for integer constants */
#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
/* 7.18.4.1. Macros for minimum-width integer constants */
/* According to ISO C 99 Technical Corrigendum 1 */
/* Here we assume a standard architecture where the hardware integer
types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */
#define INT8_C(x) x
#define UINT8_C(x) x
#define INT16_C(x) x
#define UINT16_C(x) x
#define INT32_C(x) x
#define UINT32_C(x) x ## U
# define INT64_C(x) x##L
#endif
#endif
/* 7.18.4.2. Macros for greatest-width integer constants */
#elif defined GL_INT64_T
#else
# define INTMAX_C(x) x##L
#endif
#elif defined GL_UINT64_T
#else
#endif
#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
#endif /* _GL_STDINT_H */
#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */