]> code.delx.au - gnu-emacs/commitdiff
Merge from gnulib
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Jan 2015 17:15:11 +0000 (09:15 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 6 Jan 2015 17:15:29 +0000 (09:15 -0800)
* lib/stdio.in.h, m4/stdio_h.m4: Update from gnulib, incorporating:
2015-01-05 stdio: fix use of PRIdMAX on modern mingw

ChangeLog
lib/stdio.in.h
m4/stdio_h.m4

index 36edfe638d434b3f3d6a333d77913e41de424d49..ceceb68e9dc0102c91467744234cfa9652d06bc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Merge from gnulib
+       * lib/stdio.in.h, m4/stdio_h.m4: Update from gnulib, incorporating:
+       2015-01-05 stdio: fix use of PRIdMAX on modern mingw
+
 2015-01-04  Paul Eggert  <eggert@cs.ucla.edu>
 
        * INSTALL: Mention 'make WERROR_CFLAGS='.
index 2a639c4478e08634a0e786f47b0d29d70c445426..759c94d7abf8edf026348d23f69a76a600ba5fa9 100644 (file)
    except that it indicates to GCC that the supported format string directives
    are the ones of the system printf(), rather than the ones standardized by
    ISO C99 and POSIX.  */
-#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
+#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
+# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
+  _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument)
+#else
+# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
   _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
+#endif
 
 /* _GL_ATTRIBUTE_FORMAT_SCANF
    indicates to GCC that the function takes a format string and arguments,
index 42173387afffeed31db4357a6fcee94155b72ec2..e0c4bde1f8e5cf39d248148741f027a6d7a752c4 100644 (file)
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 43
+# stdio_h.m4 serial 44
 dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,6 +12,24 @@ AC_DEFUN([gl_STDIO_H],
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   gl_NEXT_HEADERS([stdio.h])
 
+  dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and
+  dnl inttypes.h behave like gnu instead of system; we must give our
+  dnl printf wrapper the right attribute to match.
+  AC_CACHE_CHECK([whether inttypes macros match system or gnu printf],
+    [gl_cv_func_printf_attribute_flavor],
+    [AC_EGREP_CPP([findme .(ll|j)d. findme],
+      [#define __STDC_FORMAT_MACROS 1
+       #include <stdio.h>
+       #include <inttypes.h>
+       findme PRIdMAX findme
+      ], [gl_cv_func_printf_attribute_flavor=gnu],
+      [gl_cv_func_printf_attribute_flavor=system])])
+  if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
+    AC_DEFINE([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [1],
+      [Define to 1 if printf and friends should be labeled with
+       attribute "__gnu_printf__" instead of "__printf__"])
+  fi
+
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
   GNULIB_FSCANF=1