Repository navigation
[libc] Move EOF macro to stdio-macros.h - #85159
Merged
Merged
Conversation
libc++ char_traits.h assumes EOF is always available See llvm#85158 for more details.
petrhosek
requested review from
SchrodingerZhu,
lntue,
michaelrj-google and
nickdesaulniers
March 14, 2024 00:23
Member
|
@llvm/pr-subscribers-libc Author: Petr Hosek (petrhosek) Changeslibc++ char_traits.h assumes EOF is always available See #85158 for more details. Full diff: https://github.com/llvm/llvm-project/pull/85159.diff 1 Files Affected:
diff --git a/libc/config/baremetal/api.td b/libc/config/baremetal/api.td
index 80d0e0ba22ca51..e33c1ff5521902 100644
--- a/libc/config/baremetal/api.td
+++ b/libc/config/baremetal/api.td
@@ -52,6 +52,15 @@ def IntTypesAPI : PublicAPI<"inttypes.h"> {
let Types = ["imaxdiv_t"];
}
+def StdIOAPI : PublicAPI<"stdio.h"> {
+ let Macros = [
+ SimpleMacroDef<"EOF", "-1">,
+ ];
+ let Types = [
+ "size_t"
+ ];
+}
+
def StdlibAPI : PublicAPI<"stdlib.h"> {
let Types = [
"div_t",
|
lntue
reviewed
Mar 14, 2024
|
|
||
| def StdIOAPI : PublicAPI<"stdio.h"> { | ||
| let Macros = [ | ||
| SimpleMacroDef<"EOF", "-1">, |
Contributor
There was a problem hiding this comment.
Can you add this definition in libc/include/llvm-libc-macros/stdio-macros.h instead?
lntue
approved these changes
Mar 14, 2024
lntue
approved these changes
Mar 14, 2024
paleauraaaa
pushed a commit
to paleauraaaa/llvm-project
that referenced
this pull request
Oct 7, 2026
libc++ char_traits.h assumes EOF is always available See llvm#85158 for more details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libc++ char_traits.h assumes EOF is always available
See #85158 for more details.