Skip to content

[libc] Added transitive bindings for OffsetType #87397

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 6 commits into from
Apr 3, 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
5 changes: 4 additions & 1 deletion libc/config/baremetal/api.td
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def MathAPI : PublicAPI<"math.h"> {
}

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

def StdlibAPI : PublicAPI<"stdlib.h"> {
Expand Down
6 changes: 5 additions & 1 deletion libc/config/gpu/api.td
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ def StdIOAPI : PublicAPI<"stdio.h"> {
SimpleMacroDef<"_IOLBF", "1">,
SimpleMacroDef<"_IONBF", "2">,
];
let Types = ["size_t", "FILE"];
let Types = [
"FILE",
"off_t",
"size_t",
];
}

def IntTypesAPI : PublicAPI<"inttypes.h"> {
Expand Down
12 changes: 10 additions & 2 deletions libc/config/linux/api.td
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def CTypeAPI : PublicAPI<"ctype.h"> {
}

def FCntlAPI : PublicAPI<"fcntl.h"> {
let Types = ["mode_t"];
let Types = [
"mode_t",
"off_t",
];
}

def IntTypesAPI : PublicAPI<"inttypes.h"> {
Expand Down Expand Up @@ -77,7 +80,12 @@ def StdIOAPI : PublicAPI<"stdio.h"> {
SimpleMacroDef<"_IOLBF", "1">,
SimpleMacroDef<"_IONBF", "2">,
];
let Types = ["size_t", "FILE", "cookie_io_functions_t"];
let Types = [
"FILE",
"cookie_io_functions_t",
"off_t",
"size_t",
];
}

def StdlibAPI : PublicAPI<"stdlib.h"> {
Expand Down
10 changes: 6 additions & 4 deletions libc/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ add_gen_header(
DEF_FILE fcntl.h.def
GEN_HDR fcntl.h
DEPENDS
.llvm_libc_common_h
.llvm-libc-macros.fcntl_macros
.llvm-libc-types.mode_t
.llvm-libc-types.off_t
.llvm_libc_common_h
)

add_gen_header(
Expand Down Expand Up @@ -264,13 +265,14 @@ add_gen_header(
DEF_FILE stdio.h.def
GEN_HDR stdio.h
DEPENDS
.llvm_libc_common_h
.llvm-libc-macros.file_seek_macros
.llvm-libc-macros.stdio_macros
.llvm-libc-types.size_t
.llvm-libc-types.ssize_t
.llvm-libc-types.FILE
.llvm-libc-types.cookie_io_functions_t
.llvm-libc-types.off_t
.llvm-libc-types.size_t
.llvm-libc-types.ssize_t
.llvm_libc_common_h
)

add_gen_header(
Expand Down
7 changes: 5 additions & 2 deletions libc/spec/posix.td
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ def POSIX : StandardSpec<"POSIX"> {
HeaderSpec FCntl = HeaderSpec<
"fcntl.h",
[], // Macros
[ModeTType],
[
ModeTType,
OffTType,
],
[], // Enumerations
[
FunctionSpec<
Expand Down Expand Up @@ -1180,7 +1183,7 @@ def POSIX : StandardSpec<"POSIX"> {
HeaderSpec StdIO = HeaderSpec<
"stdio.h",
[], // Macros
[], // Types
[OffTType], // Types
[], // Enumerations
[
FunctionSpec<
Expand Down
1 change: 0 additions & 1 deletion libc/src/stdio/fseeko.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define LLVM_LIBC_SRC_STDIO_FSEEKO_H

#include <stdio.h>
#include <unistd.h>

namespace LIBC_NAMESPACE {

Expand Down
1 change: 0 additions & 1 deletion libc/src/stdio/ftello.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define LLVM_LIBC_SRC_STDIO_FTELLO_H

#include <stdio.h>
#include <unistd.h>

namespace LIBC_NAMESPACE {

Expand Down