X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstdint_.h;h=a4f9a4cf7b0378bfc55b87becf14522c09471bd2;hb=807ed921316f2d7cd63512310f46a470393df4a9;hp=44eca933ca414b76dbe203a19f7434b2eb9894cf;hpb=14bb18e0d286a98a241caa506b1973f368481a18;p=gnulib.git diff --git a/lib/stdint_.h b/lib/stdint_.h index 44eca933c..a4f9a4cf7 100644 --- a/lib/stdint_.h +++ b/lib/stdint_.h @@ -48,10 +48,11 @@ /* 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 @ABSOLUTE_STDINT_H@. */ -#if @HAVE_SYS_TYPES_H@ +#if @HAVE_SYS_TYPES_H@ && ! defined _AIX # include #endif @@ -62,7 +63,9 @@ /* 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. */ +# define _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H # include +# undef _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H #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. */ @@ -122,15 +125,20 @@ #define uint32_t unsigned int #undef int64_t -#undef uint64_t #if LONG_MAX >> 31 >> 31 == 1 # define int64_t long int -# define uint64_t unsigned long int #elif defined _MSC_VER # define int64_t __int64 -# define uint64_t unsigned __int64 #elif @HAVE_LONG_LONG_INT@ # define int64_t long long int +#endif + +#undef uint64_t +#if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# define uint64_t unsigned long int +#elif defined _MSC_VER +# define uint64_t unsigned __int64 +#elif @HAVE_UNSIGNED_LONG_LONG_INT@ # define uint64_t unsigned long long int #endif @@ -162,6 +170,8 @@ #define uint_least32_t uint32_t #ifdef int64_t # define int_least64_t int64_t +#endif +#ifdef uint64_t # define uint_least64_t uint64_t #endif @@ -191,6 +201,8 @@ #define uint_fast32_t unsigned int_fast32_t #ifdef int64_t # define int_fast64_t int64_t +#endif +#ifdef uint64_t # define uint_fast64_t uint64_t #endif @@ -207,15 +219,20 @@ public header files. */ #undef intmax_t -#undef uintmax_t #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define intmax_t long long int -# define uintmax_t unsigned long long int #elif defined int64_t # define intmax_t int64_t -# define uintmax_t uint64_t #else # define intmax_t long int +#endif + +#undef uintmax_t +#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define uintmax_t unsigned long long int +#elif defined uint64_t +# define uintmax_t uint64_t +#else # define uintmax_t unsigned long int #endif @@ -251,10 +268,13 @@ #undef INT64_MIN #undef INT64_MAX -#undef UINT64_MAX #ifdef int64_t # define INT64_MIN (~ INT64_MAX) # define INT64_MAX INTMAX_C (9223372036854775807) +#endif + +#undef UINT64_MAX +#ifdef uint64_t # define UINT64_MAX UINTMAX_C (18446744073709551615) #endif @@ -287,10 +307,13 @@ #undef INT_LEAST64_MIN #undef INT_LEAST64_MAX -#undef UINT_LEAST64_MAX #ifdef int64_t # define INT_LEAST64_MIN INT64_MIN # define INT_LEAST64_MAX INT64_MAX +#endif + +#undef UINT_LEAST64_MAX +#ifdef uint64_t # define UINT_LEAST64_MAX UINT64_MAX #endif @@ -323,10 +346,13 @@ #undef INT_FAST64_MIN #undef INT_FAST64_MAX -#undef UINT_FAST64_MAX #ifdef int64_t # define INT_FAST64_MIN INT64_MIN # define INT_FAST64_MAX INT64_MAX +#endif + +#undef UINT_FAST64_MAX +#ifdef uint64_t # define UINT_FAST64_MAX UINT64_MAX #endif @@ -343,13 +369,17 @@ #undef INTMAX_MIN #undef INTMAX_MAX -#undef UINTMAX_MAX #define INTMAX_MIN (~ INTMAX_MAX) #ifdef INT64_MAX # define INTMAX_MAX INT64_MAX -# define UINTMAX_MAX UINT64_MAX #else # define INTMAX_MAX INT32_MAX +#endif + +#undef UINTMAX_MAX +#ifdef UINT64_MAX +# define UINTMAX_MAX UINT64_MAX +#else # define UINTMAX_MAX UINT32_MAX #endif @@ -425,27 +455,36 @@ #undef UINT64_C #if LONG_MAX >> 31 >> 31 == 1 # define INT64_C(x) x##L -# define UINT64_C(x) x##UL #elif defined _MSC_VER # define INT64_C(x) x##i64 -# define UINT64_C(x) x##ui64 #elif @HAVE_LONG_LONG_INT@ # define INT64_C(x) x##LL +#endif +#if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# define UINT64_C(x) x##UL +#elif defined _MSC_VER +# define UINT64_C(x) x##ui64 +#elif @HAVE_UNSIGNED_LONG_LONG_INT@ # define UINT64_C(x) x##ULL #endif /* 7.18.4.2. Macros for greatest-width integer constants */ #undef INTMAX_C -#undef UINTMAX_C #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define INTMAX_C(x) x##LL -# define UINTMAX_C(x) x##ULL #elif defined int64_t # define INTMAX_C(x) INT64_C(x) -# define UINTMAX_C(x) UINT64_C(x) #else # define INTMAX_C(x) x##L +#endif + +#undef UINTMAX_C +#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define UINTMAX_C(x) x##ULL +#elif defined uint64_t +# define UINTMAX_C(x) UINT64_C(x) +#else # define UINTMAX_C(x) x##UL #endif