aboutsummaryrefslogtreecommitdiff
path: root/lib/libcxx/include/stdio.h
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-04-05 01:46:13 -0400
committerGitHub <noreply@github.com>2025-04-05 01:46:13 -0400
commit0cd31fc7ff157551cfbba5da35cd79f118d2a2e3 (patch)
treea308488f5d85184c8ec402fb3f55f1cf2704443e /lib/libcxx/include/stdio.h
parent8acedfd5baabab705946ad097746f9183ef62420 (diff)
parentcefe65c1b8abe65a22d4b68410db1be264fdeda0 (diff)
downloadzig-0cd31fc7ff157551cfbba5da35cd79f118d2a2e3.tar.gz
zig-0cd31fc7ff157551cfbba5da35cd79f118d2a2e3.zip
Merge pull request #22780 from ziglang/llvm20
LLVM 20
Diffstat (limited to 'lib/libcxx/include/stdio.h')
-rw-r--r--lib/libcxx/include/stdio.h41
1 files changed, 20 insertions, 21 deletions
diff --git a/lib/libcxx/include/stdio.h b/lib/libcxx/include/stdio.h
index 3aa559393f..20b845a00b 100644
--- a/lib/libcxx/include/stdio.h
+++ b/lib/libcxx/include/stdio.h
@@ -7,17 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#if defined(__need_FILE) || defined(__need___FILE)
-
-# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-# endif
-
-# include_next <stdio.h>
-
-#elif !defined(_LIBCPP_STDIO_H)
-# define _LIBCPP_STDIO_H
-
/*
stdio.h synopsis
@@ -98,26 +87,36 @@ int ferror(FILE* stream);
void perror(const char* s);
*/
+#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/stdio.h>
+#else
# include <__config>
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
# endif
+// The inclusion of the system's <stdio.h> is intentionally done once outside of any include
+// guards because some code expects to be able to include the underlying system header multiple
+// times to get different definitions based on the macros that are set before inclusion.
# if __has_include_next(<stdio.h>)
# include_next <stdio.h>
# endif
-# ifdef __cplusplus
+# ifndef _LIBCPP_STDIO_H
+# define _LIBCPP_STDIO_H
-# undef getc
-# undef putc
-# undef clearerr
-# undef feof
-# undef ferror
-# undef putchar
-# undef getchar
+# ifdef __cplusplus
-# endif
+# undef getc
+# undef putc
+# undef clearerr
+# undef feof
+# undef ferror
+# undef putchar
+# undef getchar
+
+# endif // __cplusplus
+# endif // _LIBCPP_STDIO_H
-#endif // _LIBCPP_STDIO_H
+#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)