From c0f0fb3c9413d74a10381b2df5185e79e4324658 Mon Sep 17 00:00:00 2001 From: auronandace Date: Tue, 12 May 2026 07:13:25 +0100 Subject: [PATCH] remove sys_types from pwd header --- src/header/pwd/cbindgen.toml | 7 ++++++- src/header/pwd/mod.rs | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/header/pwd/cbindgen.toml b/src/header/pwd/cbindgen.toml index 92e53b6f90..a12aec9356 100644 --- a/src/header/pwd/cbindgen.toml +++ b/src/header/pwd/cbindgen.toml @@ -2,7 +2,12 @@ # # Spec quotations relating to includes: # - "The header shall define the gid_t, uid_t, and size_t types as described in ." -sys_includes = ["sys/types.h"] +sys_includes = [] +after_includes = """ +#include // for gid_t from sys/types.h +#include // for size_t from sys/types.h +#include // for uid_t from sys/types.h +""" include_guard = "_RELIBC_PWD_H" language = "C" style = "Tag" diff --git a/src/header/pwd/mod.rs b/src/header/pwd/mod.rs index e581a74ba0..41e1844f44 100644 --- a/src/header/pwd/mod.rs +++ b/src/header/pwd/mod.rs @@ -30,9 +30,11 @@ use self::linux as sys; #[cfg(target_os = "redox")] use self::redox as sys; +/// cbindgen:ignore #[cfg(target_os = "linux")] const SEPARATOR: u8 = b':'; +/// cbindgen:ignore #[cfg(target_os = "redox")] const SEPARATOR: u8 = b';'; @@ -40,6 +42,7 @@ const SEPARATOR: u8 = b';'; /// for POSIX minimum requirements, and /// for further /// details. +#[allow(non_camel_case_types)] #[repr(C)] #[derive(Debug)] pub struct passwd { @@ -52,7 +55,9 @@ pub struct passwd { pub pw_shell: *mut c_char, } +/// cbindgen:ignore static mut PASSWD_BUF: Option = None; +/// cbindgen:ignore static PASSWD: RawCell = RawCell::new(passwd { pw_name: ptr::null_mut(), pw_passwd: ptr::null_mut(), @@ -119,6 +124,7 @@ enum Cause { Other, } +/// cbindgen:ignore static READER: RawCell>> = RawCell::new(None); fn parsed(buf: Option) -> Option