File tree Expand file tree Collapse file tree 21 files changed +103
-27
lines changed
utils/bazel/llvm-project-overlay/libc Expand file tree Collapse file tree 21 files changed +103
-27
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,6 @@ def FenvAPI: PublicAPI<"fenv.h"> {
59
59
}
60
60
61
61
def StdIOAPI : PublicAPI<"stdio.h"> {
62
- let Macros = [
63
- SimpleMacroDef<"_IOFBF", "0">,
64
- SimpleMacroDef<"_IOLBF", "1">,
65
- SimpleMacroDef<"_IONBF", "2">,
66
- ];
67
62
let Types = [
68
63
"FILE",
69
64
"off_t",
Original file line number Diff line number Diff line change @@ -76,9 +76,6 @@ def StdIOAPI : PublicAPI<"stdio.h"> {
76
76
SimpleMacroDef<"stderr", "stderr">,
77
77
SimpleMacroDef<"stdin", "stdin">,
78
78
SimpleMacroDef<"stdout", "stdout">,
79
- SimpleMacroDef<"_IOFBF", "0">,
80
- SimpleMacroDef<"_IOLBF", "1">,
81
- SimpleMacroDef<"_IONBF", "2">,
82
79
];
83
80
let Types = [
84
81
"FILE",
Original file line number Diff line number Diff line change @@ -69,6 +69,16 @@ add_proxy_header_library(
69
69
libc.include.signal
70
70
)
71
71
72
+ add_proxy_header_library (
73
+ stdio_macros
74
+ HDRS
75
+ stdio_macros.h
76
+ FULL_BUILD_DEPENDS
77
+ libc.include.stdio
78
+ libc.include.llvm-libc-macros.stdio_macros
79
+ libc.include.llvm-libc-macros.file_seek_macros
80
+ )
81
+
72
82
add_proxy_header_library (
73
83
sys_epoll_macros
74
84
HDRS
Original file line number Diff line number Diff line change
1
+ //===-- Definition of macros from stdio.h --------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_HDR_STDIO_MACROS_H
10
+ #define LLVM_LIBC_HDR_STDIO_MACROS_H
11
+
12
+ #ifdef LIBC_FULL_BUILD
13
+
14
+ #include "include/llvm-libc-macros/file-seek-macros.h"
15
+ #include "include/llvm-libc-macros/stdio-macros.h"
16
+
17
+ #else // Overlay mode
18
+
19
+ #include <stdio.h>
20
+
21
+ #endif // LLVM_LIBC_FULL_BUILD
22
+
23
+ #endif // LLVM_LIBC_HDR_STDIO_MACROS_H
Original file line number Diff line number Diff line change @@ -135,3 +135,12 @@ add_proxy_header_library(
135
135
libc.include.llvm-libc-types.struct_sigaction
136
136
libc.include.signal
137
137
)
138
+
139
+ add_proxy_header_library (
140
+ off_t
141
+ HDRS
142
+ off_t.h
143
+ FULL_BUILD_DEPENDS
144
+ libc.include.llvm-libc-types.off_t
145
+ libc.include.stdio
146
+ )
Original file line number Diff line number Diff line change
1
+ //===-- Proxy for off_t ---------------------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_HDR_TYPES_OFF_T_H
10
+ #define LLVM_LIBC_HDR_TYPES_OFF_T_H
11
+
12
+ #ifdef LIBC_FULL_BUILD
13
+
14
+ #include "include/llvm-libc-types/off_t.h"
15
+
16
+ #else // Overlay mode
17
+
18
+ #include <stdio.h>
19
+
20
+ #endif // LLVM_LIBC_FULL_BUILD
21
+
22
+ #endif // LLVM_LIBC_HDR_TYPES_OFF_T_H
Original file line number Diff line number Diff line change 15
15
16
16
#define BUFSIZ 1024
17
17
18
+ #define _IONBF 2
19
+ #define _IOLBF 1
20
+ #define _IOFBF 0
21
+
18
22
#endif // LLVM_LIBC_MACROS_STDIO_MACROS_H
Original file line number Diff line number Diff line change 1
1
header : stdio.h
2
2
macros :
3
- - macro_name : _IONBF
4
- macro_value : 2
5
- - macro_name : _IOLBF
6
- macro_value : 1
7
- - macro_name : _IOFBF
8
- macro_value : 0
9
3
- macro_name : stdout
10
4
macro_value : stdout
11
5
- macro_name : stdin
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ add_object_library(
16
16
libc.src.__support.CPP.span
17
17
libc.src.__support.threads.mutex
18
18
libc.src.__support.error_or
19
+ libc.hdr.types.off_t
20
+ libc.hdr.stdio_macros
19
21
)
20
22
21
23
add_object_library (
Original file line number Diff line number Diff line change 8
8
9
9
#include " file.h"
10
10
11
+ #include " hdr/stdio_macros.h"
12
+ #include " hdr/types/off_t.h"
11
13
#include " src/__support/CPP/new.h"
12
14
#include " src/__support/CPP/span.h"
13
15
#include " src/errno/libc_errno.h" // For error macros
14
16
15
- #include < stdio.h>
16
- #include < stdlib.h>
17
-
18
17
namespace LIBC_NAMESPACE {
19
18
20
19
FileIOResult File::write_unlocked (const void *data, size_t len) {
Original file line number Diff line number Diff line change 9
9
#ifndef LLVM_LIBC_SRC___SUPPORT_FILE_FILE_H
10
10
#define LLVM_LIBC_SRC___SUPPORT_FILE_FILE_H
11
11
12
- #include " include/llvm-libc-types/off_t.h"
12
+ #include " hdr/stdio_macros.h"
13
+ #include " hdr/types/off_t.h"
13
14
#include " src/__support/CPP/new.h"
14
15
#include " src/__support/error_or.h"
15
16
#include " src/__support/macros/properties/architectures.h"
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ add_object_library(
5
5
file .cpp
6
6
HDRS
7
7
file .h
8
+ lseekImpl.h
8
9
DEPENDS
9
10
libc.include.fcntl
10
11
libc.include.stdio
@@ -15,6 +16,8 @@ add_object_library(
15
16
libc.src.errno.errno
16
17
libc.src.__support.error_or
17
18
libc.src.__support.File.file
19
+ libc.hdr.types.off_t
20
+ libc.hdr.stdio_macros
18
21
)
19
22
20
23
add_object_library (
Original file line number Diff line number Diff line change 8
8
9
9
#include " file.h"
10
10
11
+ #include " hdr/stdio_macros.h"
12
+ #include " hdr/types/off_t.h"
11
13
#include " src/__support/CPP/new.h"
12
14
#include " src/__support/File/file.h"
13
15
#include " src/__support/File/linux/lseekImpl.h"
14
16
#include " src/__support/OSUtil/fcntl.h"
15
17
#include " src/__support/OSUtil/syscall.h" // For internal syscall function.
16
18
#include " src/errno/libc_errno.h" // For error macros
17
19
18
- #include < fcntl.h> // For mode_t and other flags to the open syscall
19
- #include < stdio.h>
20
+ #include < fcntl.h> // For mode_t and other flags to the open syscall
20
21
#include < sys/stat.h> // For S_IS*, S_IF*, and S_IR* flags.
21
22
#include < sys/syscall.h> // For syscall numbers
22
23
Original file line number Diff line number Diff line change 6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
9
+ #include " hdr/types/off_t.h"
9
10
#include " src/__support/File/file.h"
10
11
11
12
namespace LIBC_NAMESPACE {
Original file line number Diff line number Diff line change 9
9
#ifndef LLVM_LIBC_SRC___SUPPORT_FILE_LINUX_LSEEKIMPL_H
10
10
#define LLVM_LIBC_SRC___SUPPORT_FILE_LINUX_LSEEKIMPL_H
11
11
12
+ #include " hdr/types/off_t.h"
12
13
#include " src/__support/OSUtil/syscall.h" // For internal syscall function.
13
14
#include " src/__support/common.h"
14
15
#include " src/__support/error_or.h"
15
16
#include " src/errno/libc_errno.h"
16
17
17
18
#include < stdint.h> // For uint64_t.
18
19
#include < sys/syscall.h> // For syscall numbers.
19
- #include < unistd.h> // For off_t.
20
20
21
21
namespace LIBC_NAMESPACE {
22
22
namespace internal {
Original file line number Diff line number Diff line change @@ -21,4 +21,5 @@ add_object_library(
21
21
libc.hdr.types.struct_flock
22
22
libc.hdr.types.struct_flock64
23
23
libc.hdr.types.struct_f_owner_ex
24
+ libc.hdr.types.off_t
24
25
)
Original file line number Diff line number Diff line change 9
9
#include " src/__support/OSUtil/fcntl.h"
10
10
11
11
#include " hdr/fcntl_macros.h"
12
+ #include " hdr/types/off_t.h"
12
13
#include " hdr/types/struct_f_owner_ex.h"
13
14
#include " hdr/types/struct_flock.h"
14
15
#include " hdr/types/struct_flock64.h"
Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ add_entrypoint_object(
61
61
HDRS
62
62
fopencookie.h
63
63
DEPENDS
64
- libc.include.stdio
64
+ libc.hdr.stdio_macros
65
+ libc.hdr.types.off_t
65
66
libc.src.__support.CPP.new
66
67
libc.src.__support.File.file
67
68
)
@@ -74,7 +75,7 @@ add_entrypoint_object(
74
75
setbuf.h
75
76
DEPENDS
76
77
libc.src.errno.errno
77
- libc.include.stdio
78
+ libc.hdr.types.off_t
78
79
libc.src.__support.File.file
79
80
libc.src.__support.File.platform_file
80
81
)
Original file line number Diff line number Diff line change 7
7
// ===----------------------------------------------------------------------===//
8
8
9
9
#include " src/stdio/fopencookie.h"
10
+ #include " hdr/stdio_macros.h"
11
+ #include " hdr/types/off_t.h"
10
12
#include " src/__support/CPP/new.h"
11
13
#include " src/__support/File/file.h"
12
14
13
15
#include " src/errno/libc_errno.h"
14
- #include < stdio.h>
15
- #include < stdlib.h>
16
16
17
17
namespace LIBC_NAMESPACE {
18
18
Original file line number Diff line number Diff line change 7
7
// ===----------------------------------------------------------------------===//
8
8
9
9
#include " src/stdio/setbuf.h"
10
+ #include " hdr/stdio_macros.h"
10
11
#include " src/__support/File/file.h"
11
-
12
12
#include " src/errno/libc_errno.h"
13
- #include < stdio.h>
14
13
15
14
namespace LIBC_NAMESPACE {
16
15
Original file line number Diff line number Diff line change @@ -138,6 +138,11 @@ libc_support_library(
138
138
hdrs = ["hdr/float_macros.h" ],
139
139
)
140
140
141
+ libc_support_library (
142
+ name = "hdr_stdio_macros" ,
143
+ hdrs = ["hdr/stdio_macros.h" ],
144
+ )
145
+
141
146
############################ Type Proxy Header Files ###########################
142
147
143
148
libc_support_library (
@@ -180,6 +185,11 @@ libc_support_library(
180
185
hdrs = ["hdr/types/pid_t.h" ],
181
186
)
182
187
188
+ libc_support_library (
189
+ name = "types_off_t" ,
190
+ hdrs = ["hdr/types/off_t.h" ],
191
+ )
192
+
183
193
############################### Support libraries ##############################
184
194
185
195
libc_support_library (
@@ -667,6 +677,8 @@ libc_support_library(
667
677
":__support_error_or" ,
668
678
":__support_threads_mutex" ,
669
679
":errno" ,
680
+ ":hdr_stdio_macros" ,
681
+ ":types_off_t" ,
670
682
],
671
683
)
672
684
@@ -678,6 +690,7 @@ libc_support_library(
678
690
":__support_error_or" ,
679
691
":__support_osutil_syscall" ,
680
692
":errno" ,
693
+ ":types_off_t" ,
681
694
],
682
695
)
683
696
You can’t perform that action at this time.
0 commit comments