summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-01-06 09:15:11 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-01-06 09:15:29 -0800
commit215942da54990e097f838cd8bdb7d7164a6e3463 (patch)
treecca4ea6474a94083a48fa813fa76417e45fa1f93 /m4
parentf5afaf9ce74dd04e37d72e62ecd85fc19c06bb55 (diff)
downloademacs-215942da54990e097f838cd8bdb7d7164a6e3463.tar.gz
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
Diffstat (limited to 'm4')
-rw-r--r--m4/stdio_h.m420
1 files changed, 19 insertions, 1 deletions
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 42173387aff..e0c4bde1f8e 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -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