bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fopen-gnu: do not define __need_FILE.


From: Harald van Dijk
Subject: [PATCH] fopen-gnu: do not define __need_FILE.
Date: Mon, 3 Aug 2020 19:43:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:79.0) Gecko/20100101 Thunderbird/79.0

__need_FILE is only used here to ensure the system's <stdio.h> is
included, not to limit what <stdio.h> defines. Use gnulib's
_GL_ALREADY_INCLUDING_STDIO_H for that, which does not conflict with
libc uses of __need_FILE.

This matches what was already done in 2016 for freopen.c.
---
 lib/fopen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/fopen.c b/lib/fopen.c
index 4a0cab17c..252785019 100644
--- a/lib/fopen.c
+++ b/lib/fopen.c
@@ -19,12 +19,12 @@
 /* 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 __need_FILE
+#define _GL_ALREADY_INCLUDING_STDIO_H
 #include <config.h>
/* Get the original definition of fopen. It might be defined as a macro. */
 #include <stdio.h>
-#undef __need_FILE
+#undef _GL_ALREADY_INCLUDING_STDIO_H
static FILE *
 orig_fopen (const char *filename, const char *mode)
--
2.28.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]