-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Move EOF macro to stdio-macros.h #85159
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
Conversation
libc++ char_traits.h assumes EOF is always available See llvm#85158 for more details.
@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",
|
libc/config/baremetal/api.td
Outdated
@@ -52,6 +52,15 @@ def IntTypesAPI : PublicAPI<"inttypes.h"> { | |||
let Types = ["imaxdiv_t"]; | |||
} | |||
|
|||
def StdIOAPI : PublicAPI<"stdio.h"> { | |||
let Macros = [ | |||
SimpleMacroDef<"EOF", "-1">, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this definition in libc/include/llvm-libc-macros/stdio-macros.h
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
libc++ char_traits.h assumes EOF is always available
See #85158 for more details.