# HG changeset patch # User Eric Blake # Date 1293223190 25200 # Node ID 41026f5e29c1c23654dbfb788405a1e75b7baee2 # Parent d02ecbcfc84d4024c5e1a448713825305ffacf80 stdint: avoid HP-UX 10.20 preprocessor bug * lib/stdint.in.h (INT64_MAX, UINT64_MAX): Check via #ifdef rather than #if. * tests/test-floor2.c (main): Likewise. Reported by Peter O'Gorman. Signed-off-by: Eric Blake diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-12-24 Eric Blake + stdint: avoid HP-UX 10.20 preprocessor bug + * lib/stdint.in.h (INT64_MAX, UINT64_MAX): Check via #ifdef rather + than #if. + * tests/test-floor2.c (main): Likewise. + Reported by Peter O'Gorman. + pipe: make obsoletion transition easier * lib/pipe.h: Restore file as thin shim around "spawn-pipe.h". * modules/pipe (Files): Include revived file. diff --git a/lib/stdint.in.h b/lib/stdint.in.h --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -137,9 +137,10 @@ /* If the system defines INT64_MAX, assume int64_t works. That way, if the underlying platform defines int64_t to be a 64-bit long long int, the code below won't mistakenly define it to be a 64-bit long - int, which would mess up C++ name mangling. */ + int, which would mess up C++ name mangling. We must use #ifdef + rather than #if, to avoid an error with HP-UX 10.20 cc. */ -#if INT64_MAX +#ifdef INT64_MAX # define GL_INT64_T #else /* Do not undefine int64_t if gnulib is not being used with 64-bit @@ -162,7 +163,7 @@ # endif #endif -#if UINT64_MAX +#ifdef UINT64_MAX # define GL_UINT64_T #else # if ULONG_MAX >> 31 >> 31 >> 1 == 1 diff --git a/tests/test-floor2.c b/tests/test-floor2.c --- a/tests/test-floor2.c +++ b/tests/test-floor2.c @@ -144,7 +144,7 @@ int main () { -#if UINT64_MAX +#ifdef UINT64_MAX unsigned int highbits; unsigned int lowbits; int error = 0;