X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fstdint_.h;h=9e0faab83331280c2cd723b2ec4b708724d93c4b;hb=3054e0c0b6c3f998ea52d8d25fc2bf1700a093ca;hp=ab59dce0a4d6a485decaf3ea0437dd787b93c955;hpb=92963f62672f81f79a01e57309772c468582d87d;p=gnulib.git diff --git a/lib/stdint_.h b/lib/stdint_.h index ab59dce0a..9e0faab83 100644 --- a/lib/stdint_.h +++ b/lib/stdint_.h @@ -26,18 +26,26 @@ /* Get wchar_t, WCHAR_MIN, WCHAR_MAX. */ #include +/* BSD/OS 4.2 defines WCHAR_MIN, WCHAR_MAX in , not . */ +#if !(defined(WCHAR_MIN) && defined(WCHAR_MAX)) && @HAVE_WCHAR_H@ +# include +#endif + /* Get LONG_MIN, LONG_MAX, ULONG_MAX. */ #include /* Get those types that are already defined in other system include files. */ -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4) # include #endif -#if defined(__OpenBSD__) +#if defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi) /* In OpenBSD 3.8, includes , which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. includes and also defines intptr_t and uintptr_t. */ + /* BSD/OS 4.2 is similar, but doesn't have */ + /* IRIX 6.5 has , and defines some of these + types as well. */ # include # if @HAVE_INTTYPES_H@ # include @FULL_PATH_INTTYPES_H@ @@ -64,7 +72,17 @@ #endif #if @HAVE_STDINT_H@ /* Other systems may have an incomplete . */ -# include @FULL_PATH_STDINT_H@ + /* On some versions of IRIX, the SGI C compiler comes with an , + but + - in c99 mode, includes , + - in c89 mode, spews warnings and defines nothing. + defines only a subset of the types and macros that + would define in c99 mode. + So we rely only on (included above). It means that in + c89 mode, we shadow the contents of warning-spewing . */ +# if !(defined(__sgi) && @HAVE_INTTYPES_H@ && !defined(__c99)) +# include @FULL_PATH_STDINT_H@ +# endif #endif /* 7.18.1.1. Exact-width integer types */ @@ -243,6 +261,8 @@ typedef unsigned long uintptr_t; public header files. */ #if !@HAVE_INTMAX_T@ +/* Remove possible redundant definition from gnulib's config.h first. */ +# undef intmax_t # ifdef _STDINT_H_HAVE_INT64 typedef int64_t intmax_t; # else @@ -250,6 +270,8 @@ typedef int32_t intmax_t; # endif #endif #if !@HAVE_UINTMAX_T@ +/* Remove possible redundant definition from gnulib's config.h first. */ +# undef uintmax_t # ifdef _STDINT_H_HAVE_UINT64 typedef uint64_t uintmax_t; # else @@ -924,21 +946,46 @@ typedef uint32_t uintmax_t; #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 */ #undef INT8_C #undef UINT8_C #define INT8_C(x) x -#define UINT8_C(x) x##U +#if @HAVE_UINT8_T@ +# if @BITSIZEOF_UINT8_T@ < @BITSIZEOF_UNSIGNED_INT@ +# define UINT8_C(x) x +# else +# define UINT8_C(x) x##U +# endif +#else +# define UINT8_C(x) x +#endif #undef INT16_C #undef UINT16_C #define INT16_C(x) x -#define UINT16_C(x) x##U +#if @HAVE_UINT16_T@ +# if @BITSIZEOF_UINT16_T@ < @BITSIZEOF_UNSIGNED_INT@ +# define UINT16_C(x) x +# else +# define UINT16_C(x) x##U +# endif +#else +# define UINT16_C(x) x +#endif #undef INT32_C #undef UINT32_C #define INT32_C(x) x -#define UINT32_C(x) x##U +#if @HAVE_UINT32_T@ +# if @BITSIZEOF_UINT32_T@ < @BITSIZEOF_UNSIGNED_INT@ +# define UINT32_C(x) x +# else +# define UINT32_C(x) x##U +# endif +#else +# define UINT32_C(x) x +#endif #undef INT64_C #undef UINT64_C