Skip to content

Commit

Permalink
Merge pull request #4096 from tgross35/remove-cfg-long-array
Browse files Browse the repository at this point in the history
[0.2] Remove the `long_array` conditional
  • Loading branch information
tgross35 authored Nov 18, 2024
2 parents 6b61531 + 756a285 commit ab722fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
6 changes: 0 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
"freebsd14",
"freebsd15",
"libc_deny_warnings",
"libc_long_array",
"libc_thread_local",
"libc_ctest",
];
Expand Down Expand Up @@ -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");
Expand Down
8 changes: 0 additions & 8 deletions src/unix/bsd/apple/long_array.rs

This file was deleted.

16 changes: 9 additions & 7 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -6825,10 +6834,3 @@ cfg_if! {
// Unknown target_arch
}
}

cfg_if! {
if #[cfg(libc_long_array)] {
mod long_array;
pub use self::long_array::*;
}
}

0 comments on commit ab722fb

Please sign in to comment.