File tree Expand file tree Collapse file tree 5 files changed +39
-6
lines changed Expand file tree Collapse file tree 5 files changed +39
-6
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,16 @@ add_proxy_header_library(
32
32
libc.include.math
33
33
)
34
34
35
+ add_proxy_header_library (
36
+ errno_macros
37
+ HDRS
38
+ errno_macros.h
39
+ FULL_BUILD_DEPENDS
40
+ libc.include.errno
41
+ libc.include.llvm-libc-macros.error_number_macros
42
+ libc.include.llvm-libc-macros.generic_error_number_macros
43
+ )
44
+
35
45
add_proxy_header_library (
36
46
fcntl_macros
37
47
HDRS
Original file line number Diff line number Diff line change
1
+ //===-- Definition of macros from errno.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_ERRNO_MACROS_H
10
+ #define LLVM_LIBC_HDR_ERRNO_MACROS_H
11
+
12
+ #ifdef LIBC_FULL_BUILD
13
+
14
+ #ifdef __linux__
15
+ #include "llvm-libc-macros/error-number-macros.h"
16
+ #else // __linux__
17
+ #include "llvm-libc-macros/generic-error-number-macros.h"
18
+ #endif
19
+
20
+ #else // Overlay mode
21
+
22
+ #include <errno.h>
23
+
24
+ #endif // LLVM_LIBC_FULL_BUILD
25
+
26
+ #endif // LLVM_LIBC_HDR_ERRNO_MACROS_H
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ add_entrypoint_object(
18
18
COMPILE_OPTIONS
19
19
${full_build_flag}
20
20
DEPENDS
21
- libc.include.errno
22
- libc.include.llvm-libc-macros.error_number_macros
23
- libc.include.llvm-libc-macros.generic_error_number_macros
21
+ libc.hdr.errno_macros
24
22
libc.src.__support.common
25
23
)
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ LIBC_NAMESPACE::Errno::operator int() { return __llvmlibc_errno; }
37
37
38
38
#else
39
39
// In overlay mode, we simply use the system errno.
40
- #include < errno.h >
40
+ #include " hdr/errno_macros.h "
41
41
42
42
void LIBC_NAMESPACE::Errno::operator =(int a) { errno = a; }
43
43
LIBC_NAMESPACE::Errno::operator int () { return errno; }
Original file line number Diff line number Diff line change 12
12
#include " src/__support/macros/attributes.h"
13
13
#include " src/__support/macros/properties/architectures.h"
14
14
15
- #include < include/llvm-libc-macros/error-number-macros.h>
16
- #include < include/llvm-libc-macros/generic-error-number-macros.h>
15
+ #include " hdr/errno_macros.h"
17
16
18
17
// This header is to be consumed by internal implementations, in which all of
19
18
// them should refer to `libc_errno` instead of using `errno` directly from
You can’t perform that action at this time.
0 commit comments