X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Finttypes.in.h;h=7abf39403f01670f61346ca31f15f64d238c5000;hb=0e37faa962c9da84e85e24f409c2ff3836ba28d6;hp=f9f3119631973eb67e9f8caba1ab0e77aa6f1849;hpb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;p=gnulib.git diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index f9f311963..7abf39403 100644 --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2007 Free Software Foundation, Inc. +/* Copyright (C) 2006-2011 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. @@ -20,6 +20,11 @@ * */ +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + /* 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. @@ -33,8 +38,11 @@ #if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H #define INTTYPES_H -/* Include or the gnulib replacement. */ -#include +/* Include or the gnulib replacement. + But avoid namespace pollution on glibc systems. */ +#ifndef __GLIBC__ +# include +#endif /* Get CHAR_BIT. */ #include @@ -42,7 +50,9 @@ # error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to ." #endif -/* The definition of GL_LINK_WARNING is copied here. */ +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ /* 7.8.1 Macros for format specifiers */ @@ -165,7 +175,7 @@ # endif # endif # ifdef INT64_MAX -# if INT64_MAX == LONG_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@) # define _PRI64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRI64_PREFIX "I64" @@ -182,7 +192,7 @@ # endif # endif # ifdef UINT64_MAX -# if UINT64_MAX == ULONG_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@) # define _PRIu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _PRIu64_PREFIX "I64" @@ -483,7 +493,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 +501,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 +509,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 +517,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 +525,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 +533,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 +668,7 @@ # endif # endif # ifdef INT64_MAX -# if INT64_MAX == LONG_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@) # define _SCN64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCN64_PREFIX "I64" @@ -675,7 +685,7 @@ # endif # endif # ifdef UINT64_MAX -# if UINT64_MAX == ULONG_MAX +# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@) # define _SCNu64_PREFIX "l" # elif defined _MSC_VER || defined __MINGW32__ # define _SCNu64_PREFIX "I64" @@ -958,7 +968,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 +976,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 +984,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 +992,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 +1000,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" @@ -1042,47 +1052,52 @@ extern intmax_t imaxabs (intmax_t); # endif #elif defined GNULIB_POSIXCHECK # undef imaxabs -# define imaxabs(a) \ - (GL_LINK_WARNING ("imaxabs is unportable - " \ - "use gnulib module imaxabs for portability"), \ - imaxabs (a)) +# if HAVE_RAW_DECL_IMAXABS +_GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - " + "use gnulib module imaxabs for portability"); +# endif #endif #if @GNULIB_IMAXDIV@ # if !@HAVE_DECL_IMAXDIV@ +# if !GNULIB_defined_imaxdiv_t typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; +# define GNULIB_defined_imaxdiv_t 1 +# endif extern imaxdiv_t imaxdiv (intmax_t, intmax_t); # endif #elif defined GNULIB_POSIXCHECK # undef imaxdiv -# define imaxdiv(a,b) \ - (GL_LINK_WARNING ("imaxdiv is unportable - " \ - "use gnulib module imaxdiv for portability"), \ - imaxdiv (a, b)) +# if HAVE_RAW_DECL_IMAXDIV +_GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - " + "use gnulib module imaxdiv for portability"); +# endif #endif #if @GNULIB_STRTOIMAX@ # if !@HAVE_DECL_STRTOIMAX@ -extern intmax_t strtoimax (const char *, char **, int); +# undef strtoimax +extern intmax_t strtoimax (const char *, char **, int) _GL_ARG_NONNULL ((1)); # endif #elif defined GNULIB_POSIXCHECK # undef strtoimax -# define strtoimax(p,e,b) \ - (GL_LINK_WARNING ("strtoimax is unportable - " \ - "use gnulib module strtoimax for portability"), \ - strtoimax (p, e, b)) +# if HAVE_RAW_DECL_STRTOIMAX +_GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - " + "use gnulib module strtoimax for portability"); +# endif #endif #if @GNULIB_STRTOUMAX@ # if !@HAVE_DECL_STRTOUMAX@ -extern uintmax_t strtoumax (const char *, char **, int); +# undef strtoumax +extern uintmax_t strtoumax (const char *, char **, int) _GL_ARG_NONNULL ((1)); # endif #elif defined GNULIB_POSIXCHECK # undef strtoumax -# define strtoumax(p,e,b) \ - (GL_LINK_WARNING ("strtoumax is unportable - " \ - "use gnulib module strtoumax for portability"), \ - strtoumax (p, e, b)) +# if HAVE_RAW_DECL_STRTOUMAX +_GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - " + "use gnulib module strtoumax for portability"); +# endif #endif /* Don't bother defining or declaring wcstoimax and wcstoumax, since