changeset 37502:dba0f73c28d8

support GNU format printf and scanf on mingw Allow %lld and %Lf to work on mingw as per: http://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/
author Pádraig Brady <P@draigBrady.com>
date Tue, 02 Dec 2014 13:34:06 +0000
parents 905bd2fe6c98
children d78370899111
files m4/extensions.m4 m4/stdio_h.m4 modules/dtoastr modules/ftoastr modules/ldtoastr modules/stdio
diffstat 6 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/m4/extensions.m4	Mon Dec 08 13:19:12 2014 +0100
+++ b/m4/extensions.m4	Tue Dec 02 13:34:06 2014 +0000
@@ -68,6 +68,10 @@
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
+/* Use GNU style printf and scanf.  */
+#ifndef __USE_MINGW_ANSI_STDIO
+# undef __USE_MINGW_ANSI_STDIO
+#endif
 /* Enable threading extensions on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
@@ -100,6 +104,7 @@
   AC_DEFINE([_ALL_SOURCE])
   AC_DEFINE([_DARWIN_C_SOURCE])
   AC_DEFINE([_GNU_SOURCE])
+  AC_DEFINE([__USE_MINGW_ANSI_STDIO])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
   AC_DEFINE([_TANDEM_SOURCE])
   AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
--- a/m4/stdio_h.m4	Mon Dec 08 13:19:12 2014 +0100
+++ b/m4/stdio_h.m4	Tue Dec 02 13:34:06 2014 +0000
@@ -6,6 +6,9 @@
 
 AC_DEFUN([gl_STDIO_H],
 [
+  dnl For __USE_MINGW_ANSI_STDIO
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   gl_NEXT_HEADERS([stdio.h])
 
--- a/modules/dtoastr	Mon Dec 08 13:19:12 2014 +0100
+++ b/modules/dtoastr	Tue Dec 02 13:34:06 2014 +0000
@@ -8,6 +8,7 @@
 m4/c-strtod.m4
 
 Depends-on:
+extensions
 intprops
 
 configure.ac:
--- a/modules/ftoastr	Mon Dec 08 13:19:12 2014 +0100
+++ b/modules/ftoastr	Tue Dec 02 13:34:06 2014 +0000
@@ -7,6 +7,7 @@
 m4/c-strtod.m4
 
 Depends-on:
+extensions
 intprops
 
 configure.ac:
--- a/modules/ldtoastr	Mon Dec 08 13:19:12 2014 +0100
+++ b/modules/ldtoastr	Tue Dec 02 13:34:06 2014 +0000
@@ -8,6 +8,7 @@
 m4/c-strtod.m4
 
 Depends-on:
+extensions
 intprops
 
 configure.ac:
--- a/modules/stdio	Mon Dec 08 13:19:12 2014 +0100
+++ b/modules/stdio	Tue Dec 02 13:34:06 2014 +0000
@@ -6,6 +6,7 @@
 m4/stdio_h.m4
 
 Depends-on:
+extensions
 include_next
 snippet/arg-nonnull
 snippet/c++defs