* 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>
+
+ 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.
/* 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)
/* 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>
#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