[libc-commits] [libc] 50a19f9 - [libc] Include stdio.h in baremetal getchar.cpp (#98188)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 9 10:10:18 PDT 2024


Author: Petr Hosek
Date: 2024-07-09T10:10:15-07:00
New Revision: 50a19f94341c4d0a1a2b860b521a0d8a9515fb5f

URL: https://github.com/llvm/llvm-project/commit/50a19f94341c4d0a1a2b860b521a0d8a9515fb5f
DIFF: https://github.com/llvm/llvm-project/commit/50a19f94341c4d0a1a2b860b521a0d8a9515fb5f.diff

LOG: [libc] Include stdio.h in baremetal getchar.cpp (#98188)

This is needed for the EOF constant.

Added: 
    

Modified: 
    libc/src/stdio/baremetal/CMakeLists.txt
    libc/src/stdio/baremetal/getchar.cpp

Removed: 
    


################################################################################
diff  --git a/libc/src/stdio/baremetal/CMakeLists.txt b/libc/src/stdio/baremetal/CMakeLists.txt
index 5ace85d009040..9bfd5eb2ae0ee 100644
--- a/libc/src/stdio/baremetal/CMakeLists.txt
+++ b/libc/src/stdio/baremetal/CMakeLists.txt
@@ -5,6 +5,7 @@ add_entrypoint_object(
   HDRS
     ../getchar.h
   DEPENDS
+    libc.include.stdio
     libc.src.__support.OSUtil.osutil
     libc.src.__support.CPP.string_view
 )

diff  --git a/libc/src/stdio/baremetal/getchar.cpp b/libc/src/stdio/baremetal/getchar.cpp
index 6398197e2f143..bbd5ba7a954fb 100644
--- a/libc/src/stdio/baremetal/getchar.cpp
+++ b/libc/src/stdio/baremetal/getchar.cpp
@@ -9,6 +9,8 @@
 #include "src/stdio/getchar.h"
 #include "src/__support/OSUtil/io.h"
 
+#include <stdio.h>
+
 namespace LIBC_NAMESPACE {
 
 LLVM_LIBC_FUNCTION(int, getchar, ()) {


        


More information about the libc-commits mailing list