Files
RedBear-OS/src/header/stdlib/cbindgen.toml
T
vasilito a359fb6155 relibc: dirent/stdlib/unistd headers must include <features.h> for __deprecated
The relibc bump added #[deprecated] to readdir_r (and others); cbindgen emits
'__deprecated' (globdefs deprecated=__deprecated), which is #defined in
features.h. But dirent/stdlib/unistd generate with no_includes and never pulled
features.h, so a C unit that includes <dirent.h> before anything that defines
__deprecated fails: 'expected ; before int' (broke htop and any <dirent.h>
consumer). Added '#include <features.h>' to each header's cbindgen after_includes.
2026-07-28 18:20:16 +09:00

44 lines
1.7 KiB
TOML

# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/stdlib.h.html
#
# Spec quotations relating to includes:
# - "The <stdlib.h> header shall define NULL as described in <stddef.h>."
# - "size_t As described in <stddef.h>."
# - "wchar_t As described in <stddef.h>."
# - "In addition, the <stdlib.h> header shall define the following symbolic constants and macros as described in <sys/wait.h>: WCOREDUMP, WEXITSTATUS, WIFEXITED, WIFSIGNALED, WIFSTOPPED, WNOHANG, WSTOPSIG, WTERMSIG, WUNTRACED"
# - "The <stdlib.h> header shall define the following symbolic constants as described in <fcntl.h>: O_APPEND, O_CLOEXEC, O_CLOFORK, O_DSYNC, O_NOCTTY, O_RDWR, O_RSYNC, O_SYNC"
# - "Inclusion of the <stdlib.h> header may also make visible all symbols from <fcntl.h>, <limits.h>, <math.h>, <stddef.h>, and <sys/wait.h>."
#
# POSIX allows inclusion of stdint.h via: fcntl.h > unistd.h > stdint.h (our fcntl.h doesn't include unistd.h so just include stdint.h here directly instead)
# stdint.h needed for unintptr_t for __stack_chk_guard
# sys/wait.h brings in signal.h which brings in features.h
# features required for deprecated and no return annotations
sys_includes = ["stddef.h", "sys/wait.h", "stdint.h"]
include_guard = "_RELIBC_STDLIB_H"
after_includes = """
#include <features.h> // __deprecated
#include <bits/open-flags.h> // for O_* constants, shared with fcntl.h
"""
trailer = """
#ifndef _RELIBC_STDLIB_EXTRA_H
#define _RELIBC_STDLIB_EXTRA_H
#ifdef __cplusplus
extern "C" {
#endif
long double strtold(const char *nptr, char **endptr);
#ifdef __cplusplus
}
#endif
#endif
"""
language = "C"
style = "Type"
no_includes = true
cpp_compat = true
[enum]
prefix_with_name = true