[libc-commits] [libc] [libc][stdio] Use proxy headers of stdio.h in src and test folders. (PR #110067)

via libc-commits libc-commits at lists.llvm.org
Thu Sep 26 19:07:29 PDT 2024


================
@@ -9,6 +9,30 @@
 #ifndef LLVM_LIBC_MACROS_STDIO_MACROS_H
 #define LLVM_LIBC_MACROS_STDIO_MACROS_H
 
+#include "../llvm-libc-types/FILE.h"
+
+#ifdef __cplusplus
+extern "C" FILE *stdin;
+extern "C" FILE *stdout;
+extern "C" FILE *stderr;
+#else
+extern FILE *stdin;
+extern FILE *stdout;
+extern FILE *stderr;
+#endif
----------------
lntue wrote:

C99 (and C++) define these as macros https://en.cppreference.com/w/c/io/std_streams, and so I put their definition here together with the macros.  Probably we could factor them out to `stdio-streams.h` instead.  WDYT?

https://github.com/llvm/llvm-project/pull/110067


More information about the libc-commits mailing list