File tree Expand file tree Collapse file tree 15 files changed +158
-26
lines changed Expand file tree Collapse file tree 15 files changed +158
-26
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 15
15
16
16
#include <linux/errno.h>
17
17
18
- #ifndef ERFKILL
19
- #define ERFKILL 132
20
- #endif // ERFKILL
21
-
22
- #ifndef EOWNERDEAD
23
- #define EOWNERDEAD 130
24
- #endif // EOWNERDEAD
25
-
26
- #ifndef EHWPOISON
27
- #define EHWPOISON 133
28
- #endif // EHWPOISON
29
-
30
- #ifndef ECANCELED
31
- #define ECANCELED 125
32
- #endif // ECANCELED
33
-
34
18
#ifndef ENOTSUP
35
19
#define ENOTSUP EOPNOTSUPP
36
20
#endif // ENOTSUP
37
21
38
- #ifndef ENOTRECOVERABLE
39
- #define ENOTRECOVERABLE 131
40
- #endif // ENOTRECOVERABLE
22
+ #include "llvm-libc-macros/linux/error-number-macros.h"
41
23
42
24
#else // __linux__
43
25
#include "llvm-libc-macros/generic-error-number-macros.h"
Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ add_macro_header(
37
37
assert-macros.h
38
38
)
39
39
40
+ add_macro_header (
41
+ error_number_macros
42
+ HDR
43
+ error-number-macros.h
44
+ )
45
+
40
46
add_macro_header (
41
47
generic_error_number_macros
42
48
HDR
Original file line number Diff line number Diff line change
1
+ #ifndef LLVM_LIBC_MACROS_ERROR_NUMBER_MACROS_H
2
+ #define LLVM_LIBC_MACROS_ERROR_NUMBER_MACROS_H
3
+
4
+ #ifdef __linux__
5
+ #include "linux/error-number-macros.h"
6
+ #endif
7
+
8
+ #endif // LLVM_LIBC_MACROS_ERROR_NUMBER_MACROS_H
Original file line number Diff line number Diff line change 44
44
#define EDOM 33
45
45
#define ERANGE 34
46
46
#define EILSEQ 35
47
+ #define ENAMETOOLONG 36
48
+ #define EOVERFLOW 75
47
49
48
50
#endif // LLVM_LIBC_MACROS_GENERIC_ERROR_NUMBER_MACROS_H
Original file line number Diff line number Diff line change
1
+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /mips )
2
+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /sparc )
3
+
4
+ add_header (
5
+ error_number_macros
6
+ HDR
7
+ error-number-macros.h
8
+ DEPENDS
9
+ .mips.error_number_macros
10
+ .sparc.error_number_macros
11
+ )
12
+
1
13
add_header (
2
14
fcntl_macros
3
15
HDR
Original file line number Diff line number Diff line change
1
+ #ifndef LLVM_LIBC_MACROS_LINUX_ERROR_NUMBER_MACROS_H
2
+ #define LLVM_LIBC_MACROS_LINUX_ERROR_NUMBER_MACROS_H
3
+
4
+ #if defined(__mips__ )
5
+ #include "mips/error-number-macros.h"
6
+
7
+ #elif defined(__sparc__ )
8
+ #include "sparc/error-number-macros.h"
9
+
10
+ #else
11
+ #ifndef ECANCELED
12
+ #define ECANCELED 125
13
+ #endif // ECANCELED
14
+
15
+ #ifndef EOWNERDEAD
16
+ #define EOWNERDEAD 130
17
+ #endif // EOWNERDEAD
18
+
19
+ #ifndef ENOTRECOVERABLE
20
+ #define ENOTRECOVERABLE 131
21
+ #endif // ENOTRECOVERABLE
22
+
23
+ #ifndef ERFKILL
24
+ #define ERFKILL 132
25
+ #endif // ERFKILL
26
+
27
+ #ifndef EHWPOISON
28
+ #define EHWPOISON 133
29
+ #endif // EHWPOISON
30
+ #endif
31
+
32
+ #endif // LLVM_LIBC_MACROS_LINUX_ERROR_NUMBER_MACROS_H
Original file line number Diff line number Diff line change
1
+ add_header (
2
+ error_number_macros
3
+ HDR
4
+ error-number-macros.h
5
+ )
Original file line number Diff line number Diff line change
1
+ #ifndef LLVM_LIBC_MACROS_LINUX_MIPS_ERROR_NUMBER_MACROS_H
2
+ #define LLVM_LIBC_MACROS_LINUX_MIPS_ERROR_NUMBER_MACROS_H
3
+
4
+ #ifndef ECANCELED
5
+ #define ECANCELED 158
6
+ #endif // ECANCELED
7
+
8
+ #ifndef EOWNERDEAD
9
+ #define EOWNERDEAD 165
10
+ #endif // EOWNERDEAD
11
+
12
+ #ifndef ENOTRECOVERABLE
13
+ #define ENOTRECOVERABLE 166
14
+ #endif // ENOTRECOVERABLE
15
+
16
+ #ifndef ERFKILL
17
+ #define ERFKILL 167
18
+ #endif // ERFKILL
19
+
20
+ #ifndef EHWPOISON
21
+ #define EHWPOISON 168
22
+ #endif // EHWPOISON
23
+
24
+ #endif // LLVM_LIBC_MACROS_LINUX_MIPS_ERROR_NUMBER_MACROS_H
Original file line number Diff line number Diff line change
1
+ add_header (
2
+ error_number_macros
3
+ HDR
4
+ error-number-macros.h
5
+ )
Original file line number Diff line number Diff line change
1
+ #ifndef LLVM_LIBC_MACROS_LINUX_SPARC_ERROR_NUMBER_MACROS_H
2
+ #define LLVM_LIBC_MACROS_LINUX_SPARC_ERROR_NUMBER_MACROS_H
3
+
4
+ #ifndef ECANCELED
5
+ #define ECANCELED 127
6
+ #endif // ECANCELED
7
+
8
+ #ifndef EOWNERDEAD
9
+ #define EOWNERDEAD 132
10
+ #endif // EOWNERDEAD
11
+
12
+ #ifndef ENOTRECOVERABLE
13
+ #define ENOTRECOVERABLE 133
14
+ #endif // ENOTRECOVERABLE
15
+
16
+ #ifndef ERFKILL
17
+ #define ERFKILL 134
18
+ #endif // ERFKILL
19
+
20
+ #ifndef EHWPOISON
21
+ #define EHWPOISON 135
22
+ #endif // EHWPOISON
23
+
24
+ #endif // LLVM_LIBC_MACROS_LINUX_SPARC_ERROR_NUMBER_MACROS_H
Original file line number Diff line number Diff line change @@ -18,6 +18,6 @@ add_entrypoint_object(
18
18
COMPILE_OPTIONS
19
19
${full_build_flag}
20
20
DEPENDS
21
- libc.include.errno
21
+ libc.hdr.errno_macros
22
22
libc.src.__support.common
23
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
- // TODO: https://github.com/llvm/llvm-project/issues/80172
16
- // Separate just the definition of errno numbers in
17
- // include/llvm-libc-macros/* and only include that instead of the system
18
- // <errno.h>.
19
- #include < errno.h>
15
+ #include " hdr/errno_macros.h"
20
16
21
17
// This header is to be consumed by internal implementations, in which all of
22
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