[libc-commits] [libc] [libc] fix fileno includes (PR #98514)

via libc-commits libc-commits at lists.llvm.org
Thu Jul 11 11:19:02 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Michael Jones (michaelrj-google)

<details>
<summary>Changes</summary>

Fileno was directly including the FILE and so I missed it when replacing
all of the direct includes of stdio.h


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


3 Files Affected:

- (modified) libc/src/stdio/CMakeLists.txt (+1-9) 
- (modified) libc/src/stdio/fileno.h (+2-3) 
- (modified) libc/src/stdio/generic/fileno.cpp (+1-1) 


``````````diff
diff --git a/libc/src/stdio/CMakeLists.txt b/libc/src/stdio/CMakeLists.txt
index 91b3a864042b9..e5bf5c64ec833 100644
--- a/libc/src/stdio/CMakeLists.txt
+++ b/libc/src/stdio/CMakeLists.txt
@@ -209,15 +209,6 @@ add_entrypoint_object(
     libc.src.stdio.printf_core.vfprintf_internal
 )
 
-add_stdio_entrypoint_object(
-  fileno
-  SRCS
-    fileno.cpp
-  HDRS
-    fileno.h
-  DEPENDS
-    libc.src.stdio.fileno
-)
 
 add_subdirectory(printf_core)
 add_subdirectory(scanf_core)
@@ -251,6 +242,7 @@ add_stdio_entrypoint_object(ferror_unlocked)
 add_stdio_entrypoint_object(fseek)
 add_stdio_entrypoint_object(ftell)
 add_stdio_entrypoint_object(fseeko)
+add_stdio_entrypoint_object(fileno)
 add_stdio_entrypoint_object(ftello)
 add_stdio_entrypoint_object(fflush)
 add_stdio_entrypoint_object(clearerr)
diff --git a/libc/src/stdio/fileno.h b/libc/src/stdio/fileno.h
index d41f112226c51..667061afbc94d 100644
--- a/libc/src/stdio/fileno.h
+++ b/libc/src/stdio/fileno.h
@@ -1,5 +1,4 @@
-//===-- Implementation header of fileno --------------------------*- C++
-//-*-===//
+//===-- Implementation header of fileno -------------------------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -10,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_STDIO_FILENO_H
 #define LLVM_LIBC_SRC_STDIO_FILENO_H
 
-#include "include/llvm-libc-types/FILE.h"
+#include "hdr/types/FILE.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/stdio/generic/fileno.cpp b/libc/src/stdio/generic/fileno.cpp
index 663ba92663762..4ead752c43dda 100644
--- a/libc/src/stdio/generic/fileno.cpp
+++ b/libc/src/stdio/generic/fileno.cpp
@@ -9,7 +9,7 @@
 
 #include "src/stdio/fileno.h"
 
-#include "include/llvm-libc-types/FILE.h"
+#include "hdr/types/FILE.h"
 #include "src/__support/File/file.h"
 
 namespace LIBC_NAMESPACE {

``````````

</details>


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


More information about the libc-commits mailing list