NEWS.stable: log cherry-pick [8b18afa]->[c948e19] sys_select: Avoid a syntax error...
[gnulib.git] / lib / inttypes.in.h
index bd9d0d2..7abf394 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2008 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.
 
    Written by Paul Eggert, Bruno Haible, Derek Price.
    This file is part of gnulib.
 
  * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
  */
 
  * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
  */
 
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
 /* Include the original <inttypes.h> 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.
    The include_next requires a split double-inclusion guard.  */
 #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 # if @HAVE_INTTYPES_H@
 /* Include the original <inttypes.h> 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.
    The include_next requires a split double-inclusion guard.  */
 #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 # if @HAVE_INTTYPES_H@
-#  if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#  endif
 #  @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
 # endif
 #endif
 #  @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
 # endif
 #endif
 #if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 #define INTTYPES_H
 
 #if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 #define INTTYPES_H
 
-/* Include <stdint.h> or the gnulib replacement.  */
-#include <stdint.h>
+/* Include <stdint.h> or the gnulib replacement.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <stdint.h>
+#endif
 /* Get CHAR_BIT.  */
 #include <limits.h>
 
 /* Get CHAR_BIT.  */
 #include <limits.h>
 
@@ -45,7 +50,9 @@
 # error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>."
 #endif
 
 # error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>."
 #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 */
 
 
 /* 7.8.1 Macros for format specifiers */
 
 #  endif
 # endif
 # ifdef INT64_MAX
 #  endif
 # endif
 # ifdef INT64_MAX
-#  if @INT64_MAX_EQ_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"
 #   define _PRI64_PREFIX "l"
 #  elif defined _MSC_VER || defined __MINGW32__
 #   define _PRI64_PREFIX "I64"
 #  endif
 # endif
 # ifdef UINT64_MAX
 #  endif
 # endif
 # ifdef UINT64_MAX
-#  if @UINT64_MAX_EQ_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"
 #   define _PRIu64_PREFIX "l"
 #  elif defined _MSC_VER || defined __MINGW32__
 #   define _PRIu64_PREFIX "I64"
 #  endif
 # endif
 # ifdef INT64_MAX
 #  endif
 # endif
 # ifdef INT64_MAX
-#  if @INT64_MAX_EQ_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"
 #   define _SCN64_PREFIX "l"
 #  elif defined _MSC_VER || defined __MINGW32__
 #   define _SCN64_PREFIX "I64"
 #  endif
 # endif
 # ifdef UINT64_MAX
 #  endif
 # endif
 # ifdef UINT64_MAX
-#  if @UINT64_MAX_EQ_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"
 #   define _SCNu64_PREFIX "l"
 #  elif defined _MSC_VER || defined __MINGW32__
 #   define _SCNu64_PREFIX "I64"
@@ -1045,47 +1052,52 @@ extern intmax_t imaxabs (intmax_t);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef imaxabs
 # 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@
 #endif
 
 #if @GNULIB_IMAXDIV@
 # if !@HAVE_DECL_IMAXDIV@
+#  if !GNULIB_defined_imaxdiv_t
 typedef struct { intmax_t quot; intmax_t rem; } 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
 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@
 #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
 # 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@
 #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
 # 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
 #endif
 
 /* Don't bother defining or declaring wcstoimax and wcstoumax, since