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

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


https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/98515

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


>From 8e5a4955b975e088530bcc875cd54d99276d31d2 Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Thu, 11 Jul 2024 11:35:10 -0700
Subject: [PATCH] [libc] fix baremetal getchar

baremetal getchar got the wrong find/replace in the initial patch. This
patch fixes it.
---
 libc/src/stdio/baremetal/CMakeLists.txt | 2 +-
 libc/src/stdio/baremetal/getchar.cpp    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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 {
 



More information about the libc-commits mailing list