Skip to content

[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

Merged
merged 5 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libc/config/baremetal/api.td
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def IntTypesAPI : PublicAPI<"inttypes.h"> {
let Types = ["imaxdiv_t"];
}

def StdIOAPI : PublicAPI<"stdio.h"> {
let Types = ["size_t"];
}

def StdlibAPI : PublicAPI<"stdlib.h"> {
let Types = [
"div_t",
Expand Down
1 change: 0 additions & 1 deletion libc/config/gpu/api.td
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def StdIOAPI : PublicAPI<"stdio.h"> {
SimpleMacroDef<"_IOFBF", "0">,
SimpleMacroDef<"_IOLBF", "1">,
SimpleMacroDef<"_IONBF", "2">,
SimpleMacroDef<"EOF", "-1">,
];
let Types = ["size_t", "FILE"];
}
Expand Down
1 change: 0 additions & 1 deletion libc/config/linux/api.td
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def StdIOAPI : PublicAPI<"stdio.h"> {
SimpleMacroDef<"_IOFBF", "0">,
SimpleMacroDef<"_IOLBF", "1">,
SimpleMacroDef<"_IONBF", "2">,
SimpleMacroDef<"EOF", "-1">,
];
let Types = ["size_t", "FILE", "cookie_io_functions_t"];
}
Expand Down
4 changes: 4 additions & 0 deletions libc/include/llvm-libc-macros/stdio-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#ifndef LLVM_LIBC_MACROS_STDIO_MACROS_H
#define LLVM_LIBC_MACROS_STDIO_MACROS_H

#ifndef EOF
#define EOF (-1)
#endif

#define BUFSIZ 1024

#endif // LLVM_LIBC_MACROS_STDIO_MACROS_H