|
37 | 37 | // libc doesn't maintain any internal state, instead the embedder must define |
38 | 38 | // `int *__llvm_libc_errno(void);` C function. |
39 | 39 | #define LIBC_ERRNO_MODE_EXTERNAL 4 |
40 | | -// libc uses system `<errno.h>` `errno` macro directly in the overlay mode; in |
41 | | -// fullbuild mode, effectively the same as `LIBC_ERRNO_MODE_EXTERNAL`. |
42 | | -// In this mode, the public C++ symbol `LIBC_NAMESPACE::libc_errno ` is still |
43 | | -// exported and get redirected to the system `errno` inside its implementation. |
44 | | - |
45 | | -// TODO: Investigate deprecating LIBC_ERRNO_MODE_SYSTEM in favor of |
46 | | -// LIBC_ERRNO_MODE_SYSTEM_INLINE. |
47 | | -// https://github.com/llvm/llvm-project/issues/143454 |
48 | | -#define LIBC_ERRNO_MODE_SYSTEM 5 |
| 40 | +// DEPRECATED: #define LIBC_ERRNO_MODE_SYSTEM 5 |
49 | 41 | // In this mode, the libc_errno is simply a macro resolved to `errno` from the |
50 | 42 | // system header <errno.h>. There is no need to link against the |
51 | | -// `libc.src.errno.errno` object. |
| 43 | +// `libc.src.errno.errno` object, and public C++ symbol |
| 44 | +// `LIBC_NAMESPACE::libc_errno` doesn't exist. |
52 | 45 | #define LIBC_ERRNO_MODE_SYSTEM_INLINE 6 |
53 | 46 |
|
54 | 47 | #if !defined(LIBC_ERRNO_MODE) || LIBC_ERRNO_MODE == LIBC_ERRNO_MODE_DEFAULT |
55 | 48 | #undef LIBC_ERRNO_MODE |
56 | 49 | #if defined(LIBC_FULL_BUILD) || !defined(LIBC_COPT_PUBLIC_PACKAGING) |
57 | 50 | #define LIBC_ERRNO_MODE LIBC_ERRNO_MODE_THREAD_LOCAL |
58 | 51 | #else |
59 | | -#define LIBC_ERRNO_MODE LIBC_ERRNO_MODE_SYSTEM |
| 52 | +#define LIBC_ERRNO_MODE LIBC_ERRNO_MODE_SYSTEM_INLINE |
60 | 53 | #endif |
61 | 54 | #endif // LIBC_ERRNO_MODE |
62 | 55 |
|
|
65 | 58 | LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_THREAD_LOCAL && \ |
66 | 59 | LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SHARED && \ |
67 | 60 | LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_EXTERNAL && \ |
68 | | - LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM && \ |
69 | 61 | LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM_INLINE |
70 | 62 | #error LIBC_ERRNO_MODE must be one of the following values: \ |
71 | 63 | LIBC_ERRNO_MODE_DEFAULT, \ |
72 | 64 | LIBC_ERRNO_MODE_UNDEFINED, \ |
73 | 65 | LIBC_ERRNO_MODE_THREAD_LOCAL, \ |
74 | 66 | LIBC_ERRNO_MODE_SHARED, \ |
75 | 67 | LIBC_ERRNO_MODE_EXTERNAL, \ |
76 | | -LIBC_ERRNO_MODE_SYSTEM, \ |
77 | 68 | LIBC_ERRNO_MODE_SYSTEM_INLINE. |
78 | 69 | #endif |
79 | 70 |
|
|
0 commit comments