Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.2] Remove the long_array conditional #4096

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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::*;
}
}