Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] fix fileno includes #98514

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Conversation

michaelrj-google
Copy link
Contributor

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

Fileno was directly including the FILE and so I missed it when replacing
all of the direct includes of stdio.h
@llvmbot llvmbot added the libc label Jul 11, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 11, 2024

@llvm/pr-subscribers-libc

Author: Michael Jones (michaelrj-google)

Changes

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 --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 {

@michaelrj-google michaelrj-google merged commit 9340c9f into llvm:main Jul 11, 2024
6 of 7 checks passed
@michaelrj-google michaelrj-google deleted the libcFilenoFix branch July 11, 2024 18:21
petrhosek pushed a commit to petrhosek/llvm-project that referenced this pull request Jul 11, 2024
Fileno was directly including the FILE and so I missed it when replacing
all of the direct includes of stdio.h
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
Fileno was directly including the FILE and so I missed it when replacing
all of the direct includes of stdio.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants