]> Savannah Git Hosting - gnulib.git/commitdiff
stdio: Support several gnulib-tool invocations better.
authorBruno Haible <bruno@clisp.org>
Tue, 24 Dec 2024 10:19:49 +0000 (11:19 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 25 Dec 2024 14:27:21 +0000 (15:27 +0100)
* lib/stdio.in.h: Test _GL_SKIP_GNULIB_STDIO_H.
(_GL_ALREADY_INCLUDING_STDIO_H): Rename to a macro that depends on
GUARD_PREFIX.
* lib/fopen.c: Set _GL_SKIP_GNULIB_STDIO_H instead of
_GL_ALREADY_INCLUDING_STDIO_H.
* lib/freopen.c: Likewise.

ChangeLog
lib/fopen.c
lib/freopen.c
lib/stdio.in.h

index 35c4132c89f8bb41fdad71ed4317a2aeabed64d5..494ed029d1024e56d14f6501aca8a0c1372b8750 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-12-24  Bruno Haible  <bruno@clisp.org>
+
+       stdio: Support several gnulib-tool invocations better.
+       * lib/stdio.in.h: Test _GL_SKIP_GNULIB_STDIO_H.
+       (_GL_ALREADY_INCLUDING_STDIO_H): Rename to a macro that depends on
+       GUARD_PREFIX.
+       * lib/fopen.c: Set _GL_SKIP_GNULIB_STDIO_H instead of
+       _GL_ALREADY_INCLUDING_STDIO_H.
+       * lib/freopen.c: Likewise.
+
 2024-12-24  Bruno Haible  <bruno@clisp.org>
 
        spawn: Support several gnulib-tool invocations better.
index d3b57a987a07106bc223f3c30c8e01024c27d441..b9e6e37374479a2f13c9fd3485e4a73dad0c8fad 100644 (file)
 /* If the user's config.h happens to include <stdio.h>, let it include only
    the system's <stdio.h> here, so that orig_fopen doesn't recurse to
    rpl_fopen.  */
-#define _GL_ALREADY_INCLUDING_STDIO_H
+#define _GL_SKIP_GNULIB_STDIO_H
 #include <config.h>
 
 /* Get the original definition of fopen.  It might be defined as a macro.  */
 #include <stdio.h>
-#undef _GL_ALREADY_INCLUDING_STDIO_H
+#undef _GL_SKIP_GNULIB_STDIO_H
 
 static FILE *
 orig_fopen (const char *filename, const char *mode)
index e003c0ba7f61ed24454fa8e4aeff218cd5e02c10..ab4a40dfe0937b8285aa77b3f720a872cfad1006 100644 (file)
 /* If the user's config.h happens to include <stdio.h>, let it include only
    the system's <stdio.h> here, so that orig_freopen doesn't recurse to
    rpl_freopen.  */
-#define _GL_ALREADY_INCLUDING_STDIO_H
+#define _GL_SKIP_GNULIB_STDIO_H
 #include <config.h>
 
 /* Get the original definition of freopen.  It might be defined as a macro.  */
 #include <stdio.h>
-#undef _GL_ALREADY_INCLUDING_STDIO_H
+#undef _GL_SKIP_GNULIB_STDIO_H
 
 #include <errno.h>
 
index 2462c29a3ea91589720e734daaddc2c4cbfdeecc..e5aa5a97ef0f9412d4c0c35473ca1613ffbd84fc 100644 (file)
@@ -20,7 +20,7 @@
 #endif
 @PRAGMA_COLUMNS@
 
-#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
+#if defined __need_FILE || defined __need___FILE || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_STDIO_H || defined _GL_SKIP_GNULIB_STDIO_H
 /* Special invocation convention:
    - Inside glibc header files.
    - On OSF/1 5.1 we have a sequence of nested includes
 # endif
 #endif
 
-#define _GL_ALREADY_INCLUDING_STDIO_H
+#define _@GUARD_PREFIX@_ALREADY_INCLUDING_STDIO_H
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
 
-#undef _GL_ALREADY_INCLUDING_STDIO_H
+#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_STDIO_H
 
 #ifdef _GL_DEFINED__POSIX_C_SOURCE
 # undef _GL_DEFINED__POSIX_C_SOURCE