From a359fb6155effac76e27b5f5b08dbb2d4ff03339 Mon Sep 17 00:00:00 2001 From: vasilito Date: Tue, 28 Jul 2026 18:20:16 +0900 Subject: [PATCH] relibc: dirent/stdlib/unistd headers must include 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 before anything that defines __deprecated fails: 'expected ; before int' (broke htop and any consumer). Added '#include ' to each header's cbindgen after_includes. --- src/header/dirent/cbindgen.toml | 1 + src/header/stdlib/cbindgen.toml | 1 + src/header/unistd/cbindgen.toml | 1 + 3 files changed, 3 insertions(+) diff --git a/src/header/dirent/cbindgen.toml b/src/header/dirent/cbindgen.toml index 6e8d9fbba9..c271bc5410 100644 --- a/src/header/dirent/cbindgen.toml +++ b/src/header/dirent/cbindgen.toml @@ -6,6 +6,7 @@ include_guard = "_RELIBC_DIRENT_H" language = "C" style = "Both" after_includes = """ +#include // __deprecated #include // for size_t from sys/types.h #include // for ssize_t from sys/types.h #include // for ino_t from sys/types.h diff --git a/src/header/stdlib/cbindgen.toml b/src/header/stdlib/cbindgen.toml index 7e8b9ec42d..cb5abf3266 100644 --- a/src/header/stdlib/cbindgen.toml +++ b/src/header/stdlib/cbindgen.toml @@ -15,6 +15,7 @@ sys_includes = ["stddef.h", "sys/wait.h", "stdint.h"] include_guard = "_RELIBC_STDLIB_H" after_includes = """ +#include // __deprecated #include // for O_* constants, shared with fcntl.h """ trailer = """ diff --git a/src/header/unistd/cbindgen.toml b/src/header/unistd/cbindgen.toml index a998d91c62..7047977e46 100644 --- a/src/header/unistd/cbindgen.toml +++ b/src/header/unistd/cbindgen.toml @@ -19,6 +19,7 @@ sys_includes = ["stddef.h", "stdint.h", "fcntl.h"] include_guard = "_RELIBC_UNISTD_H" after_includes = """ +#include // __deprecated #include // for ssize_t from sys/types.h // for deprecated ualarm and usleep #include // for useconds_t from sys/types.h