/* 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. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, see . */ /* * Subset of ISO C 99 for platforms that lack it. * */ #ifndef _UNISTRING_STDINT_H /* When including a system file that in turn includes , use the system , not our substitute. This avoids problems with (for example) VMS, whose includes . */ #define _GL_JUST_INCLUDE_SYSTEM_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@ # if defined __sgi && ! defined __c99 /* Bypass IRIX's 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 . Include it before , since any "#include " in would reinclude us, skipping our contents because _UNISTRING_STDINT_H is defined. The include_next requires a split double-inclusion guard. */ # if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ # endif # @INCLUDE_NEXT@ @NEXT_STDINT_H@ #endif #if ! defined _UNISTRING_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H #define _UNISTRING_STDINT_H /* defines some of the stdint.h types as well, on glibc, IRIX 6.5, and OpenBSD 3.8 (via ). AIX 5.2 isn't needed and causes troubles. MacOS X 10.4.6 includes (which is us), but relies on the system definitions, so include after @NEXT_STDINT_H@. */ #if @HAVE_SYS_TYPES_H@ && ! defined _AIX # include #endif /* Get LONG_MIN, LONG_MAX, ULONG_MAX. */ #include #if @HAVE_INTTYPES_H@ /* In OpenBSD 3.8, includes , which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. also defines intptr_t and uintptr_t. */ # include #elif @HAVE_SYS_INTTYPES_H@ /* Solaris 7 has the types except the *_fast*_t types, and the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ # include #endif #if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ /* Linux libc4 >= 4.6.7 and libc5 have a that defines int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is included by . */ # include #endif #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* 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. */ #undef int8_t #undef uint8_t typedef signed char unistring_int8_t; typedef unsigned char unistring_uint8_t; #define int8_t unistring_int8_t #define uint8_t unistring_uint8_t #undef int16_t #undef uint16_t typedef short int unistring_int16_t; typedef unsigned short int unistring_uint16_t; #define int16_t unistring_int16_t #define uint16_t unistring_uint16_t #undef int32_t #undef uint32_t typedef int unistring_int32_t; typedef unsigned int unistring_uint32_t; #define int32_t unistring_int32_t #define uint32_t unistring_uint32_t /* Avoid collision with Solaris 2.5.1 etc. */ #define _UINT8_T #define _UINT32_T #endif /* _UNISTRING_STDINT_H */ #endif /* !defined _UNISTRING_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */