From 756a285046b99c35955d50a387d1c343bb0be80b Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Mon, 18 Nov 2024 07:37:02 -0500 Subject: [PATCH] Remove the `long_array` conditional --- build.rs | 6 ------ src/unix/bsd/apple/long_array.rs | 8 -------- src/unix/bsd/apple/mod.rs | 16 +++++++++------- 3 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 src/unix/bsd/apple/long_array.rs diff --git a/build.rs b/build.rs index e1c9b23c4617f..8b599183f5ec9 100644 --- a/build.rs +++ b/build.rs @@ -15,7 +15,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[ "freebsd14", "freebsd15", "libc_deny_warnings", - "libc_long_array", "libc_thread_local", "libc_ctest", ]; @@ -77,11 +76,6 @@ fn main() { set_cfg("libc_deny_warnings"); } - // Rust >= 1.47 supports long array: - if rustc_minor_ver >= 47 || rustc_dep_of_std { - set_cfg("libc_long_array"); - } - // #[thread_local] is currently unstable if rustc_dep_of_std { set_cfg("libc_thread_local"); diff --git a/src/unix/bsd/apple/long_array.rs b/src/unix/bsd/apple/long_array.rs deleted file mode 100644 index 4c56a275ab32a..0000000000000 --- a/src/unix/bsd/apple/long_array.rs +++ /dev/null @@ -1,8 +0,0 @@ -s! { - pub struct ctl_info { - pub ctl_id: u32, - pub ctl_name: [::c_char; MAX_KCTL_NAME], - } -} - -pub const MAX_KCTL_NAME: usize = 96; diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index f8f888fa20666..a2c0319f1dc1b 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1307,6 +1307,12 @@ s! { pub iffmid_id: u32, pub iffmid_str: [::c_char; 1], } + + // kern_control.h + pub struct ctl_info { + pub ctl_id: u32, + pub ctl_name: [::c_char; MAX_KCTL_NAME], + } } s_no_extra_traits! { @@ -5753,6 +5759,9 @@ pub const NETLINK_GENERIC: ::c_int = 0; pub const DOT3COMPLIANCE_STATS: ::c_int = 1; pub const DOT3COMPLIANCE_COLLS: ::c_int = 2; +// kern_control.h +pub const MAX_KCTL_NAME: usize = 96; + f! { pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr) -> *mut ::cmsghdr { @@ -6825,10 +6834,3 @@ cfg_if! { // Unknown target_arch } } - -cfg_if! { - if #[cfg(libc_long_array)] { - mod long_array; - pub use self::long_array::*; - } -}