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.
This commit is contained in:
2026-07-28 18:20:16 +09:00
parent b3ae554bd9
commit a359fb6155
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@ include_guard = "_RELIBC_DIRENT_H"
language = "C"
style = "Both"
after_includes = """
#include <features.h> // __deprecated
#include <bits/size-t.h> // for size_t from sys/types.h
#include <bits/ssize-t.h> // for ssize_t from sys/types.h
#include <bits/ino-t.h> // for ino_t from sys/types.h
+1
View File
@@ -15,6 +15,7 @@
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 = """
+1
View File
@@ -19,6 +19,7 @@
sys_includes = ["stddef.h", "stdint.h", "fcntl.h"]
include_guard = "_RELIBC_UNISTD_H"
after_includes = """
#include <features.h> // __deprecated
#include <bits/ssize-t.h> // for ssize_t from sys/types.h
// for deprecated ualarm and usleep
#include <bits/useconds-t.h> // for useconds_t from sys/types.h