[libc] Define Annex K's errno_t in specified headers (#187700)

- Change `errno.h.def` to include a placeholder where hdrgen emits the
public API, which contains the `errno_t` definition.
- Make headers `stdio.h`, `stdlib.h`, `string.h` and `time.h` also
define `errno_t` as specified in the standard.
This commit is contained in:
Victor Campos
2026-03-25 12:30:19 +00:00
committed by GitHub
parent 5e89d60586
commit 27ba9e2a44
6 changed files with 11 additions and 1 deletions

View File

@@ -253,6 +253,7 @@ add_header_macro(
DEPENDS
.llvm_libc_common_h
.llvm-libc-macros.null_macro
.llvm-libc-types.errno_t
.llvm-libc-types.size_t
)
@@ -288,6 +289,7 @@ add_header_macro(
.llvm-libc-macros.null_macro
.llvm-libc-macros.time_macros
.llvm-libc-types.clock_t
.llvm-libc-types.errno_t
.llvm-libc-types.time_t
.llvm-libc-types.struct_tm
.llvm-libc-types.struct_timespec
@@ -366,6 +368,7 @@ add_header_macro(
.llvm-libc-macros.stdio_macros
.llvm-libc-types.FILE
.llvm-libc-types.cookie_io_functions_t
.llvm-libc-types.errno_t
.llvm-libc-types.off_t
.llvm-libc-types.size_t
.llvm-libc-types.ssize_t
@@ -385,6 +388,7 @@ add_header_macro(
.llvm-libc-types.__search_compare_t
.llvm-libc-types.constraint_handler_t
.llvm-libc-types.div_t
.llvm-libc-types.errno_t
.llvm-libc-types.ldiv_t
.llvm-libc-types.lldiv_t
.llvm-libc-types.locale_t

View File

@@ -31,6 +31,8 @@
#endif
%%public_api()
__BEGIN_C_DECLS
int *__llvm_libc_errno(void) __NOEXCEPT;

View File

@@ -14,6 +14,7 @@ types:
- type_name: off_t
- type_name: cookie_io_functions_t
- type_name: FILE
- type_name: errno_t
enums: []
objects:
- object_name: stdin

View File

@@ -18,7 +18,8 @@ types:
- type_name: lldiv_t
- type_name: locale_t
- type_name: size_t
- type_name: wchar_t
- type_name: wchar_t
- type_name: errno_t
enums: []
objects: []
functions:

View File

@@ -5,6 +5,7 @@ macros:
- macro_name: "NULL"
macro_header: null-macro.h
types:
- type_name: errno_t
- type_name: locale_t
- type_name: size_t
enums: []

View File

@@ -6,6 +6,7 @@ macros:
types:
- type_name: struct_timeval
- type_name: clockid_t
- type_name: errno_t
- type_name: struct_timespec
- type_name: struct_tm
- type_name: time_t