summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-04-26 06:06:03 +0200
committerBruno Haible <bruno@clisp.org>2023-04-26 06:06:03 +0200
commit2c2f6738b579517f91bee29a22746012d90e9ad5 (patch)
tree0e57b1737920340d982dfce0a6326cc5993cb1a9 /m4
parent3ef794d11bcbea3b8ae57767772a3255b669b8ce (diff)
downloadgnulib-2c2f6738b579517f91bee29a22746012d90e9ad5.tar.gz
fclose: Make last change more maintainable.
* m4/fclose.m4 (gl_FUNC_FCLOSE): Define through AC_DEFUN_ONCE. Don't modify REPLACE_FOPEN. * modules/fclose (Depends-on): Add comment. (configure.ac): Don't modify REPLACE_FOPEN. Don't duplicate actions of module 'fopen'. * m4/fopen.m4 (gl_FUNC_FOPEN_ITSELF): Renamed from gl_FUNC_FOPEN. (gl_FUNC_FOPEN): New macro. * modules/fopen (Files): Add m4/fclose.m4, m4/fflush.m4. * m4/close.m4 (gl_FUNC_CLOSE): Define through AC_DEFUN_ONCE.
Diffstat (limited to 'm4')
-rw-r--r--m4/close.m44
-rw-r--r--m4/fclose.m48
-rw-r--r--m4/fopen.m413
3 files changed, 15 insertions, 10 deletions
diff --git a/m4/close.m4 b/m4/close.m4
index 9f95c670e5..0feabd6917 100644
--- a/m4/close.m4
+++ b/m4/close.m4
@@ -1,10 +1,10 @@
-# close.m4 serial 9
+# close.m4 serial 10
dnl Copyright (C) 2008-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([gl_FUNC_CLOSE],
+AC_DEFUN_ONCE([gl_FUNC_CLOSE],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
m4_ifdef([gl_MSVC_INVAL], [
diff --git a/m4/fclose.m4 b/m4/fclose.m4
index 74b7df0a77..e9291f0bda 100644
--- a/m4/fclose.m4
+++ b/m4/fclose.m4
@@ -1,10 +1,10 @@
-# fclose.m4 serial 10
+# fclose.m4 serial 11
dnl Copyright (C) 2008-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([gl_FUNC_FCLOSE],
+AC_DEFUN_ONCE([gl_FUNC_FCLOSE],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
@@ -31,10 +31,6 @@ AC_DEFUN([gl_FUNC_FCLOSE],
*) REPLACE_FCLOSE=1 ;;
esac
fi
-
- if test $REPLACE_FCLOSE = 1; then
- REPLACE_FOPEN=1
- fi
])
dnl Determine whether fclose works on input streams.
diff --git a/m4/fopen.m4 b/m4/fopen.m4
index 6806394f8c..7daa4caec5 100644
--- a/m4/fopen.m4
+++ b/m4/fopen.m4
@@ -1,10 +1,10 @@
-# fopen.m4 serial 14
+# fopen.m4 serial 15
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([gl_FUNC_FOPEN],
+AC_DEFUN([gl_FUNC_FOPEN_ITSELF],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
@@ -58,6 +58,15 @@ changequote([,])dnl
esac
])
+AC_DEFUN([gl_FUNC_FOPEN],
+[
+ AC_REQUIRE([gl_FUNC_FOPEN_ITSELF])
+ AC_REQUIRE([gl_FUNC_FCLOSE])
+ if test $REPLACE_FCLOSE = 1; then
+ REPLACE_FOPEN=1
+ fi
+])
+
AC_DEFUN([gl_FUNC_FOPEN_GNU],
[
AC_REQUIRE([gl_FUNC_FOPEN])