From a324fe18db8f5d23a816d7861f57ba83b154fc2f 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 | 9 +++++++++ 3 files changed, 9 insertions(+), 14 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 1bf743e1cd7ad..c5d72cc99de45 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1307,6 +1307,12 @@ s! { pub ifs6_out_mldreport: ::u_quad_t, pub ifs6_out_mlddone: ::u_quad_t, } + + // 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 {