diff options
Diffstat (limited to 'gl/m4/fopen.m4')
| -rw-r--r-- | gl/m4/fopen.m4 | 25 |
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 |
| 2 | dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. | 2 | # serial 16 |
| 3 | dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. | ||
| 3 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 5 | dnl gives unlimited permission to copy and/or distribute it, |
| 5 | dnl with or without modifications, as long as this notice is preserved. | 6 | dnl with or without modifications, as long as this notice is preserved. |
| 7 | dnl This file is offered as-is, without any warranty. | ||
| 6 | 8 | ||
| 7 | AC_DEFUN([gl_FUNC_FOPEN], | 9 | AC_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 | ||
| 63 | AC_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 | |||
| 61 | AC_DEFUN([gl_FUNC_FOPEN_GNU], | 72 | AC_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 | *) |
