Skip to content

Commit

Permalink
Require rust >= 1.33 and drop libc_packedN conditional
Browse files Browse the repository at this point in the history
[ resolve conflicts, update to latest - Trevor ]
  • Loading branch information
joshtriplett authored and tgross35 committed Nov 16, 2024
1 parent c99b2fc commit 4f16e4a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
4 changes: 1 addition & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
"libc_deny_warnings",
"libc_long_array",
"libc_non_exhaustive",
"libc_packedN",
"libc_ptr_addr_of",
"libc_thread_local",
"libc_underscore_const_names",
Expand Down Expand Up @@ -85,9 +84,8 @@ fn main() {
set_cfg("libc_deny_warnings");
}

// Rust >= 1.33 supports repr(packed(N)) and cfg(target_vendor).
// Rust >= 1.33 supports cfg(target_vendor).
if rustc_minor_ver >= 33 || rustc_dep_of_std {
set_cfg("libc_packedN");
set_cfg("libc_cfg_target_vendor");
}

Expand Down
2 changes: 1 addition & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn do_ctest() {

fn ctest_cfg() -> ctest::TestGenerator {
let mut cfg = ctest::TestGenerator::new();
let libc_cfgs = ["libc_packedN", "libc_thread_local"];
let libc_cfgs = ["libc_thread_local"];
for f in &libc_cfgs {
cfg.cfg(f, None);
}
Expand Down
22 changes: 11 additions & 11 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,13 +1193,13 @@ s! {
}

s_no_extra_traits! {
#[cfg_attr(libc_packedN, repr(packed(4)))]
#[repr(packed(4))]
pub struct ifconf {
pub ifc_len: ::c_int,
pub ifc_ifcu: __c_anonymous_ifc_ifcu,
}

#[cfg_attr(libc_packedN, repr(packed(4)))]
#[repr(packed(4))]
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: i16,
Expand All @@ -1209,7 +1209,7 @@ s_no_extra_traits! {
pub udata: *mut ::c_void,
}

#[cfg_attr(libc_packedN, repr(packed(4)))]
#[repr(packed(4))]
pub struct semid_ds {
// Note the manpage shows different types than the system header.
pub sem_perm: ipc_perm,
Expand All @@ -1222,7 +1222,7 @@ s_no_extra_traits! {
pub sem_pad3: [i32; 4],
}

#[cfg_attr(libc_packedN, repr(packed(4)))]
#[repr(packed(4))]
pub struct shmid_ds {
pub shm_perm: ipc_perm,
pub shm_segsz: ::size_t,
Expand Down Expand Up @@ -1381,7 +1381,7 @@ s_no_extra_traits! {
pub pth_name: [::c_char; MAXTHREADNAMESIZE],
}

#[cfg_attr(libc_packedN, repr(packed(4)))]
#[repr(packed(4))]
pub struct if_data64 {
pub ifi_type: ::c_uchar,
pub ifi_typelen: ::c_uchar,
Expand Down Expand Up @@ -1413,7 +1413,7 @@ s_no_extra_traits! {
pub ifi_lastchange: timeval32,
}

#[cfg_attr(libc_packedN, repr(packed(4)))]
#[repr(packed(4))]
pub struct if_msghdr2 {
pub ifm_msglen: ::c_ushort,
pub ifm_version: ::c_uchar,
Expand All @@ -1428,7 +1428,7 @@ s_no_extra_traits! {
pub ifm_data: if_data64,
}

#[cfg_attr(libc_packedN, repr(packed(8)))]
#[repr(packed(8))]
pub struct vm_statistics64 {
pub free_count: natural_t,
pub active_count: natural_t,
Expand Down Expand Up @@ -1456,7 +1456,7 @@ s_no_extra_traits! {
pub total_uncompressed_pages_in_compressor: u64,
}

#[cfg_attr(libc_packedN, repr(packed(4)))]
#[repr(packed(4))]
pub struct mach_task_basic_info {
pub virtual_size: mach_vm_size_t,
pub resident_size: mach_vm_size_t,
Expand All @@ -1467,7 +1467,7 @@ s_no_extra_traits! {
pub suspend_count: integer_t,
}

#[cfg_attr(libc_packedN, repr(packed(4)))]
#[repr(packed(4))]
pub struct log2phys {
pub l2p_flags: ::c_uint,
pub l2p_contigbytes: ::off_t,
Expand All @@ -1478,7 +1478,7 @@ s_no_extra_traits! {
_os_unfair_lock_opaque: u32,
}

#[cfg_attr(libc_packedN, repr(packed(1)))]
#[repr(packed(1))]
pub struct sockaddr_vm {
pub svm_len: ::c_uchar,
pub svm_family: ::sa_family_t,
Expand All @@ -1498,7 +1498,7 @@ s_no_extra_traits! {
pub ifk_value: ::c_int,
}

#[cfg_attr(libc_packedN, repr(packed(4)))]
#[repr(packed(4))]
pub struct ifkpi {
pub ifk_module_id: ::c_uint,
pub ifk_type: ::c_uint,
Expand Down
5 changes: 1 addition & 4 deletions src/unix/solarish/illumos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ s! {
}

s_no_extra_traits! {
#[cfg_attr(any(
target_arch = "x86", target_arch = "x86_64"),
repr(packed(4))
)]
#[cfg_attr(any(target_arch = "x86", target_arch = "x86_64"), repr(packed(4)))]
pub struct epoll_event {
pub events: u32,
pub u64: u64,
Expand Down

0 comments on commit 4f16e4a

Please sign in to comment.