]> Savannah Git Hosting - gnulib.git/commitdiff
stdio: Avoid different configure results in different testdirs.
authorBruno Haible <bruno@clisp.org>
Sat, 29 Apr 2023 01:24:43 +0000 (03:24 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 5 May 2023 11:02:21 +0000 (13:02 +0200)
* m4/stdio_h.m4 (gl_STDIO_H_EARLY): New macro, extracted from
gl_STDIO_H.
(gl_STDIO_H): Move the code that sets __USE_MINGW_ANSI_STDIO to
gl_STDIO_H_EARLY.
* modules/stdio (configure.ac-early): New section.

ChangeLog
m4/stdio_h.m4
modules/stdio

index 9829ed9d7d3759393237786ebc6131c7eb0ef8ca..6a2930e01a064bcb23018e6335afd5243bf070a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-04-28  Bruno Haible  <bruno@clisp.org>
+
+       stdio: Avoid different configure results in different testdirs.
+       * m4/stdio_h.m4 (gl_STDIO_H_EARLY): New macro, extracted from
+       gl_STDIO_H.
+       (gl_STDIO_H): Move the code that sets __USE_MINGW_ANSI_STDIO to
+       gl_STDIO_H_EARLY.
+       * modules/stdio (configure.ac-early): New section.
+
 2023-04-28  Bruno Haible  <bruno@clisp.org>
 
        stdbool tests: Avoid compilation error with Sun C on Solaris 10.
index 42e96071f8b361047286152bc18808ac7195e869..40b262ea09150a3baec669db2a03886aae0cf16d 100644 (file)
@@ -1,12 +1,22 @@
-# stdio_h.m4 serial 59
-dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+# stdio_h.m4 serial 59.1
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN_ONCE([gl_STDIO_H],
+AC_DEFUN([gl_STDIO_H_EARLY],
 [
-  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  dnl Defining __USE_MINGW_ANSI_STDIO to 1 must be done early, because
+  dnl the results of several configure tests depend on it: The tests
+  dnl   - checking whether snprintf returns a byte count as in C99...
+  dnl   - checking whether snprintf truncates the result as in C99...
+  dnl   - checking whether printf supports the 'F' directive...
+  dnl   - checking whether printf supports the grouping flag...
+  dnl   - checking whether printf supports the zero flag correctly...
+  dnl   - checking whether printf supports infinite 'double' arguments...
+  dnl   - checking whether printf supports large precisions...
+  dnl report 'yes' if __USE_MINGW_ANSI_STDIO is 1 but 'no' if
+  dnl __USE_MINGW_ANSI_STDIO is not set.
   AH_VERBATIM([MINGW_ANSI_STDIO],
 [/* Use GNU style printf and scanf.  */
 #ifndef __USE_MINGW_ANSI_STDIO
@@ -14,6 +24,11 @@ AC_DEFUN_ONCE([gl_STDIO_H],
 #endif
 ])
   AC_DEFINE([__USE_MINGW_ANSI_STDIO])
+])
+
+AC_DEFUN_ONCE([gl_STDIO_H],
+[
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   gl_NEXT_HEADERS([stdio.h])
 
   dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and
index ff3a8d55af7556b516ef5bc44f2db4b508d5cdc7..d22b7e52f5a2edba3b87305e4f59afae682b1f1f 100644 (file)
@@ -18,6 +18,9 @@ ssize_t
 stddef
 sys_types
 
+configure.ac-early:
+gl_STDIO_H_EARLY
+
 configure.ac:
 gl_STDIO_H
 gl_STDIO_H_REQUIRE_DEFAULTS