diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2007-11-12 15:50:17 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2007-11-12 15:50:17 -0800 |
commit | 2fd369d04b4b9022ee48695882bf98d2d51a33dd (patch) | |
tree | 14b93bbc760c76030b060b02655fd0b2de63015f /lib/inttypes.in.h | |
parent | a635ca9c01d6e9a747ac9c0c2eed04658486d400 (diff) | |
download | gnulib-2fd369d04b4b9022ee48695882bf98d2d51a33dd.tar.gz |
Don't insist on 'long long int' support in the preprocessor. It
breaks too many things. For example, PRIdMAX still uses a 'long
long int' format with the latest Sun compiler, even though
HAVE_LONG_LONG_INT isn't defined due to that compiler's
preprocessor problem. This causes the latest coreutils to dump
core on Solaris 10 sparc with the Sun C compiler.
Instead, fix the 2007-10-16 problem in a different way, by evaluating
the troublesome expressions at configure-time, not at #if-time.
* m4/longlong.m4 (_AC_TYPE_LONG_LONG_SNIPPET): Don't test the
preprocessor.
* m4/inttypes.m4 (gl_INTTYPES_H): Move the #if checks into
compile-time C checks, done at 'configure'-time.
(gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION): New macro.
* modules/inttypes (Makefile): Substitute the new symbols that
gl_INTTYPES_H now generates.
* lib/inttypes.in.h: Don't use constants wider than 'long' in #if.
Diffstat (limited to 'lib/inttypes.in.h')
-rw-r--r-- | lib/inttypes.in.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index f9f3119631..8a24850562 100644 --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -165,7 +165,7 @@ # endif # endif # ifdef INT64_MAX -# if INT64_MAX == LONG_MAX +# if @INT64_MAX_EQ_LONG_MAX@ # define _PRI64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRI64_PREFIX "I64" @@ -182,7 +182,7 @@ # endif # endif # ifdef UINT64_MAX -# if UINT64_MAX == ULONG_MAX +# if @UINT64_MAX_EQ_ULONG_MAX@ # define _PRIu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRIu64_PREFIX "I64" @@ -483,7 +483,7 @@ # if !defined PRIdMAX || @PRI_MACROS_BROKEN@ # undef PRIdMAX -# if INTMAX_MAX > INT32_MAX +# if @INT32_MAX_LT_INTMAX_MAX@ # define PRIdMAX PRId64 # else # define PRIdMAX "ld" @@ -491,7 +491,7 @@ # endif # if !defined PRIiMAX || @PRI_MACROS_BROKEN@ # undef PRIiMAX -# if INTMAX_MAX > INT32_MAX +# if @INT32_MAX_LT_INTMAX_MAX@ # define PRIiMAX PRIi64 # else # define PRIiMAX "li" @@ -499,7 +499,7 @@ # endif # if !defined PRIoMAX || @PRI_MACROS_BROKEN@ # undef PRIoMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIoMAX PRIo64 # else # define PRIoMAX "lo" @@ -507,7 +507,7 @@ # endif # if !defined PRIuMAX || @PRI_MACROS_BROKEN@ # undef PRIuMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIuMAX PRIu64 # else # define PRIuMAX "lu" @@ -515,7 +515,7 @@ # endif # if !defined PRIxMAX || @PRI_MACROS_BROKEN@ # undef PRIxMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIxMAX PRIx64 # else # define PRIxMAX "lx" @@ -523,7 +523,7 @@ # endif # if !defined PRIXMAX || @PRI_MACROS_BROKEN@ # undef PRIXMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIXMAX PRIX64 # else # define PRIXMAX "lX" @@ -658,7 +658,7 @@ # endif # endif # ifdef INT64_MAX -# if INT64_MAX == LONG_MAX +# if @INT64_MAX_EQ_LONG_MAX@ # define _SCN64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCN64_PREFIX "I64" @@ -675,7 +675,7 @@ # endif # endif # ifdef UINT64_MAX -# if UINT64_MAX == ULONG_MAX +# if @UINT64_MAX_EQ_ULONG_MAX@ # define _SCNu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCNu64_PREFIX "I64" @@ -958,7 +958,7 @@ # if !defined SCNdMAX || @PRI_MACROS_BROKEN@ # undef SCNdMAX -# if INTMAX_MAX > INT32_MAX +# if @INT32_MAX_LT_INTMAX_MAX@ # define SCNdMAX SCNd64 # else # define SCNdMAX "ld" @@ -966,7 +966,7 @@ # endif # if !defined SCNiMAX || @PRI_MACROS_BROKEN@ # undef SCNiMAX -# if INTMAX_MAX > INT32_MAX +# if @INT32_MAX_LT_INTMAX_MAX@ # define SCNiMAX SCNi64 # else # define SCNiMAX "li" @@ -974,7 +974,7 @@ # endif # if !defined SCNoMAX || @PRI_MACROS_BROKEN@ # undef SCNoMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNoMAX SCNo64 # else # define SCNoMAX "lo" @@ -982,7 +982,7 @@ # endif # if !defined SCNuMAX || @PRI_MACROS_BROKEN@ # undef SCNuMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNuMAX SCNu64 # else # define SCNuMAX "lu" @@ -990,7 +990,7 @@ # endif # if !defined SCNxMAX || @PRI_MACROS_BROKEN@ # undef SCNxMAX -# if UINTMAX_MAX > UINT32_MAX +# if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNxMAX SCNx64 # else # define SCNxMAX "lx" |