[libc-commits] [libc] [libc] fix baremetal getchar (PR #98515)

via libc-commits libc-commits at lists.llvm.org
Thu Jul 11 11:36:33 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Michael Jones (michaelrj-google)

<details>
<summary>Changes</summary>

baremetal getchar got the wrong find/replace in the initial patch. This
patch fixes it.


---
Full diff: https://github.com/llvm/llvm-project/pull/98515.diff


2 Files Affected:

- (modified) libc/src/stdio/baremetal/CMakeLists.txt (+1-1) 
- (modified) libc/src/stdio/baremetal/getchar.cpp (+1-1) 


``````````diff
diff --git a/libc/src/stdio/baremetal/CMakeLists.txt b/libc/src/stdio/baremetal/CMakeLists.txt
index 9bfd5eb2ae0ee..c5cf4a8e0e5b5 100644
--- a/libc/src/stdio/baremetal/CMakeLists.txt
+++ b/libc/src/stdio/baremetal/CMakeLists.txt
@@ -5,7 +5,7 @@ add_entrypoint_object(
   HDRS
     ../getchar.h
   DEPENDS
-    libc.include.stdio
+    libc.hdr.stdio_macros
     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 0cd7c59b495dd..01a5a587e5bce 100644
--- a/libc/src/stdio/baremetal/getchar.cpp
+++ b/libc/src/stdio/baremetal/getchar.cpp
@@ -9,7 +9,7 @@
 #include "src/stdio/getchar.h"
 #include "src/__support/OSUtil/io.h"
 
-#include "hdr/types/FILE.h"
+#include "hdr/stdio_macros.h" // for EOF.
 
 namespace LIBC_NAMESPACE {
 

``````````

</details>


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


More information about the libc-commits mailing list