summaryrefslogtreecommitdiffstats
path: root/gl/m4/fopen.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/fopen.m4')
-rw-r--r--gl/m4/fopen.m425
1 files changed, 18 insertions, 7 deletions
diff --git a/gl/m4/fopen.m4 b/gl/m4/fopen.m4
index 9c39ff72..e27b3270 100644
--- a/gl/m4/fopen.m4
+++ b/gl/m4/fopen.m4
@@ -1,15 +1,17 @@
1# fopen.m4 serial 13 1# fopen.m4
2dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 2# serial 16
3dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7dnl This file is offered as-is, without any warranty.
6 8
7AC_DEFUN([gl_FUNC_FOPEN], 9AC_DEFUN([gl_FUNC_FOPEN_ITSELF],
8[ 10[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS]) 11 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
10 AC_REQUIRE([AC_CANONICAL_HOST]) 12 AC_REQUIRE([AC_CANONICAL_HOST])
11 case "$host_os" in 13 case "$host_os" in
12 mingw* | pw*) 14 mingw* | windows* | pw*)
13 dnl Replace fopen, for handling of "/dev/null". 15 dnl Replace fopen, for handling of "/dev/null".
14 REPLACE_FOPEN=1 16 REPLACE_FOPEN=1
15 dnl fopen on mingw also has the trailing slash bug. 17 dnl fopen on mingw also has the trailing slash bug.
@@ -58,6 +60,15 @@ changequote([,])dnl
58 esac 60 esac
59]) 61])
60 62
63AC_DEFUN([gl_FUNC_FOPEN],
64[
65 AC_REQUIRE([gl_FUNC_FOPEN_ITSELF])
66 AC_REQUIRE([gl_FUNC_FCLOSE])
67 if test $REPLACE_FCLOSE = 1; then
68 REPLACE_FOPEN=1
69 fi
70])
71
61AC_DEFUN([gl_FUNC_FOPEN_GNU], 72AC_DEFUN([gl_FUNC_FOPEN_GNU],
62[ 73[
63 AC_REQUIRE([gl_FUNC_FOPEN]) 74 AC_REQUIRE([gl_FUNC_FOPEN])
@@ -87,7 +98,7 @@ int main ()
87 [gl_cv_func_fopen_mode_x=no], 98 [gl_cv_func_fopen_mode_x=no],
88 [case "$host_os" in 99 [case "$host_os" in
89 # Guess yes on glibc and musl systems. 100 # Guess yes on glibc and musl systems.
90 linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*) 101 linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl* | midipix*)
91 gl_cv_func_fopen_mode_x="guessing yes" ;; 102 gl_cv_func_fopen_mode_x="guessing yes" ;;
92 # If we don't know, obey --enable-cross-guesses. 103 # If we don't know, obey --enable-cross-guesses.
93 *) 104 *)
@@ -124,10 +135,10 @@ int main ()
124 [gl_cv_func_fopen_mode_e=no], 135 [gl_cv_func_fopen_mode_e=no],
125 [case "$host_os" in 136 [case "$host_os" in
126 # Guess yes on glibc and musl systems. 137 # Guess yes on glibc and musl systems.
127 linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*) 138 linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl* | midipix*)
128 gl_cv_func_fopen_mode_e="guessing yes" ;; 139 gl_cv_func_fopen_mode_e="guessing yes" ;;
129 # Guess no on native Windows. 140 # Guess no on native Windows.
130 mingw*) 141 mingw* | windows*)
131 gl_cv_func_fopen_mode_e="guessing no" ;; 142 gl_cv_func_fopen_mode_e="guessing no" ;;
132 # If we don't know, obey --enable-cross-guesses. 143 # If we don't know, obey --enable-cross-guesses.
133 *) 144 *)