From de516b22e5cf05f9fe420d8b81dd8fea22230cbb Mon Sep 17 00:00:00 2001 From: auronandace Date: Tue, 10 Mar 2026 11:20:47 +0000 Subject: [PATCH 1/2] verify header includes for sys_types --- src/header/sys_types/cbindgen.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/header/sys_types/cbindgen.toml b/src/header/sys_types/cbindgen.toml index 3d50b41267..5587e87709 100644 --- a/src/header/sys_types/cbindgen.toml +++ b/src/header/sys_types/cbindgen.toml @@ -1,10 +1,17 @@ +# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_types.h.html +# +# There are no spec quotations relating to includes +# +# - sys/types_internal.h are fundamental C types (which includes stddef.h) +# - bits/pthread.h is separate for convenience +# - features.h saves importing separately for any header that imports sys/types.h +# # no default C includes - they cause recursive dependencies and do weird stuff no_includes = true sys_includes = [ # Import most necessary, internal types first "sys/types_internal.h", - "stddef.h", "bits/pthread.h", "features.h", ] From d8dc04d3356df84c1065c14b7d9b1c4dc36853c7 Mon Sep 17 00:00:00 2001 From: auronandace Date: Tue, 10 Mar 2026 11:24:51 +0000 Subject: [PATCH 2/2] only import the needed types in bits_pthread --- src/header/bits_pthread/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/header/bits_pthread/mod.rs b/src/header/bits_pthread/mod.rs index 72f43cbaff..5c4a1d3e51 100644 --- a/src/header/bits_pthread/mod.rs +++ b/src/header/bits_pthread/mod.rs @@ -1,6 +1,6 @@ #![allow(non_camel_case_types)] -use crate::platform::types::*; +use crate::platform::types::{c_int, c_uchar, c_ulong, c_void, size_t}; // XXX: https://github.com/eqrion/cbindgen/issues/685 //