X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Finttypes_.h;h=2379540369d500e5632707bdc55fb081b6c7fb2f;hb=39bc7a80b6719b1c7d0f8fb1b01380649cb8e358;hp=f9ff39a78d8a821853e3aacd6fa6f0a021b06c76;hpb=1c01f30b6b6a4b087e613f7122095058bfa36c54;p=gnulib.git diff --git a/lib/inttypes_.h b/lib/inttypes_.h index f9ff39a78..237954036 100644 --- a/lib/inttypes_.h +++ b/lib/inttypes_.h @@ -16,7 +16,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef INTTYPES_H +/* Include the original if it exists, and if this file + has not been included yet or if this file includes gnulib stdint.h + which in turn includes this file. */ +#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H +# if @HAVE_INTTYPES_H@ +# include @ABSOLUTE_INTTYPES_H@ +# endif +#endif + +#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H #define INTTYPES_H /* @@ -24,10 +33,6 @@ * */ -/* Include the original if it exists. */ -#if @HAVE_INTTYPES_H@ -# include @ABSOLUTE_INTTYPES_H@ -#endif /* Include or the gnulib replacement. */ #include /* Get CHAR_BIT. */ @@ -41,6 +46,14 @@ #if ! defined __cplusplus || defined __STDC_FORMAT_MACROS +# if defined _TNS_R_TARGET + /* Tandem NonStop R series and compatible platforms released before + July 2005 support %Ld but not %lld. */ +# define _LONG_LONG_FORMAT_PREFIX "L" +# else +# define _LONG_LONG_FORMAT_PREFIX "ll" +# endif + # if !defined PRId8 || @PRI_MACROS_BROKEN@ # undef PRId8 # ifdef INT8_MAX @@ -155,7 +168,7 @@ # elif defined _MSC_VER || defined __MINGW32__ # define _PRI64_PREFIX "I64" # elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define _PRI64_PREFIX "ll" +# define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined PRId64 || @PRI_MACROS_BROKEN@ # undef PRId64 @@ -167,12 +180,12 @@ # endif # endif # ifdef UINT64_MAX -# if INT64_MAX == LONG_MAX +# if UINT64_MAX == ULONG_MAX # define _PRIu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRIu64_PREFIX "I64" -# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define _PRIu64_PREFIX "ll" +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined PRIo64 || @PRI_MACROS_BROKEN@ # undef PRIo64 @@ -648,7 +661,7 @@ # elif defined _MSC_VER || defined __MINGW32__ # define _SCN64_PREFIX "I64" # elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define _SCN64_PREFIX "ll" +# define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined SCNd64 || @PRI_MACROS_BROKEN@ # undef SCNd64 @@ -660,12 +673,12 @@ # endif # endif # ifdef UINT64_MAX -# if INT64_MAX == LONG_MAX +# if UINT64_MAX == ULONG_MAX # define _SCNu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCNu64_PREFIX "I64" -# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define _SCNu64_PREFIX "ll" +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif # if !defined SCNo64 || @PRI_MACROS_BROKEN@ # undef SCNo64