diff options
Diffstat (limited to 'gl/m4/fopen.m4')
| -rw-r--r-- | gl/m4/fopen.m4 | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/gl/m4/fopen.m4 b/gl/m4/fopen.m4 index 9c39ff72..f3b7aadd 100644 --- a/gl/m4/fopen.m4 +++ b/gl/m4/fopen.m4 | |||
| @@ -1,15 +1,16 @@ | |||
| 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-2024 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. |
| 6 | 7 | ||
| 7 | AC_DEFUN([gl_FUNC_FOPEN], | 8 | AC_DEFUN([gl_FUNC_FOPEN_ITSELF], |
| 8 | [ | 9 | [ |
| 9 | AC_REQUIRE([gl_STDIO_H_DEFAULTS]) | 10 | AC_REQUIRE([gl_STDIO_H_DEFAULTS]) |
| 10 | AC_REQUIRE([AC_CANONICAL_HOST]) | 11 | AC_REQUIRE([AC_CANONICAL_HOST]) |
| 11 | case "$host_os" in | 12 | case "$host_os" in |
| 12 | mingw* | pw*) | 13 | mingw* | windows* | pw*) |
| 13 | dnl Replace fopen, for handling of "/dev/null". | 14 | dnl Replace fopen, for handling of "/dev/null". |
| 14 | REPLACE_FOPEN=1 | 15 | REPLACE_FOPEN=1 |
| 15 | dnl fopen on mingw also has the trailing slash bug. | 16 | dnl fopen on mingw also has the trailing slash bug. |
| @@ -58,6 +59,15 @@ changequote([,])dnl | |||
| 58 | esac | 59 | esac |
| 59 | ]) | 60 | ]) |
| 60 | 61 | ||
| 62 | AC_DEFUN([gl_FUNC_FOPEN], | ||
| 63 | [ | ||
| 64 | AC_REQUIRE([gl_FUNC_FOPEN_ITSELF]) | ||
| 65 | AC_REQUIRE([gl_FUNC_FCLOSE]) | ||
| 66 | if test $REPLACE_FCLOSE = 1; then | ||
| 67 | REPLACE_FOPEN=1 | ||
| 68 | fi | ||
| 69 | ]) | ||
| 70 | |||
| 61 | AC_DEFUN([gl_FUNC_FOPEN_GNU], | 71 | AC_DEFUN([gl_FUNC_FOPEN_GNU], |
| 62 | [ | 72 | [ |
| 63 | AC_REQUIRE([gl_FUNC_FOPEN]) | 73 | AC_REQUIRE([gl_FUNC_FOPEN]) |
| @@ -87,7 +97,7 @@ int main () | |||
| 87 | [gl_cv_func_fopen_mode_x=no], | 97 | [gl_cv_func_fopen_mode_x=no], |
| 88 | [case "$host_os" in | 98 | [case "$host_os" in |
| 89 | # Guess yes on glibc and musl systems. | 99 | # Guess yes on glibc and musl systems. |
| 90 | linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*) | 100 | linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl* | midipix*) |
| 91 | gl_cv_func_fopen_mode_x="guessing yes" ;; | 101 | gl_cv_func_fopen_mode_x="guessing yes" ;; |
| 92 | # If we don't know, obey --enable-cross-guesses. | 102 | # If we don't know, obey --enable-cross-guesses. |
| 93 | *) | 103 | *) |
| @@ -124,10 +134,10 @@ int main () | |||
| 124 | [gl_cv_func_fopen_mode_e=no], | 134 | [gl_cv_func_fopen_mode_e=no], |
| 125 | [case "$host_os" in | 135 | [case "$host_os" in |
| 126 | # Guess yes on glibc and musl systems. | 136 | # Guess yes on glibc and musl systems. |
| 127 | linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*) | 137 | linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl* | midipix*) |
| 128 | gl_cv_func_fopen_mode_e="guessing yes" ;; | 138 | gl_cv_func_fopen_mode_e="guessing yes" ;; |
| 129 | # Guess no on native Windows. | 139 | # Guess no on native Windows. |
| 130 | mingw*) | 140 | mingw* | windows*) |
| 131 | gl_cv_func_fopen_mode_e="guessing no" ;; | 141 | gl_cv_func_fopen_mode_e="guessing no" ;; |
| 132 | # If we don't know, obey --enable-cross-guesses. | 142 | # If we don't know, obey --enable-cross-guesses. |
| 133 | *) | 143 | *) |
