Skip to content
Open
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: 3 additions & 3 deletions src/fuchsia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ s! {
pub f_namelen: c_ulong,
pub f_frsize: c_ulong,
pub f_flags: c_ulong,
pub f_spare: [c_ulong; 4],
f_spare: Padding<[c_ulong; 4]>,
}

pub struct msghdr {
Expand All @@ -858,7 +858,7 @@ s! {

pub struct cmsghdr {
pub cmsg_len: crate::socklen_t,
pub __pad1: c_int,
__pad1: Padding<c_int>,
pub cmsg_level: c_int,
pub cmsg_type: c_int,
}
Expand Down Expand Up @@ -924,7 +924,7 @@ s! {
pub totalswap: c_ulong,
pub freeswap: c_ulong,
pub procs: c_ushort,
pub pad: c_ushort,
pad: Padding<c_ushort>,
pub totalhigh: c_ulong,
pub freehigh: c_ulong,
pub mem_unit: c_uint,
Expand Down
3 changes: 1 addition & 2 deletions src/new/apple/xnu/mach/arm/_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//!
//! <https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/mach/arm/_structs.h>

#[cfg(target_arch = "arm")]
use crate::prelude::*;

s! {
Expand All @@ -19,7 +18,7 @@ s! {
pub __sp: u64,
pub __pc: u64,
pub __cpsr: u32,
pub __pad: u32,
__pad: Padding<u32>,
}

#[cfg(target_arch = "aarch64")]
Expand Down
10 changes: 5 additions & 5 deletions src/new/apple/xnu/mach/i386/_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ s! {
}

pub struct __darwin_x86_float_state64 {
pub __fpu_reserved: [c_int; 2],
__fpu_reserved: Padding<[c_int; 2]>,
__fpu_fcw: c_short,
__fpu_fsw: c_short,
pub __fpu_ftw: u8,
pub __fpu_rsrv1: u8,
__fpu_rsrv1: Padding<u8>,
pub __fpu_fop: u16,
pub __fpu_ip: u32,
pub __fpu_cs: u16,
pub __fpu_rsrv2: u16,
__fpu_rsrv2: Padding<u16>,
pub __fpu_dp: u32,
pub __fpu_ds: u16,
pub __fpu_rsrv3: u16,
__fpu_rsrv3: Padding<u16>,
pub __fpu_mxcsr: u32,
pub __fpu_mxcsrmask: u32,
pub __fpu_stmm0: __darwin_mmst_reg,
Expand Down Expand Up @@ -87,6 +87,6 @@ s! {
// FIXME(apple): this field is actually [u8; 96], but defining it with a bigger type allows
// us to auto-implement traits for it since the length of the array is less than 32
__fpu_rsrv4: [u32; 24],
pub __fpu_reserved1: c_int,
__fpu_reserved1: Padding<c_int>,
}
}
2 changes: 1 addition & 1 deletion src/new/apple/xnu/net/bpf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ s_no_extra_traits! {

pub union __c_anonymous_bfl_u {
pub bflu_list: *mut u32,
pub bflu_pad: u64,
bflu_pad: Padding<u64>,
}
}

Expand Down
11 changes: 5 additions & 6 deletions src/new/glibc/sysdeps/unix/linux/net/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ use crate::prelude::*;

s! {
pub struct rtentry {
pub rt_pad1: c_ulong,
rt_pad1: Padding<c_ulong>,
pub rt_dst: crate::sockaddr,
pub rt_gateway: crate::sockaddr,
pub rt_genmask: crate::sockaddr,
pub rt_flags: c_ushort,
pub rt_pad2: c_short,
pub rt_pad3: c_ulong,
rt_pad2: Padding<c_short>,
rt_pad3: Padding<c_ulong>,
pub rt_tos: c_uchar,
pub rt_class: c_uchar,
// FIXME(1.0): private padding fields
#[cfg(target_pointer_width = "64")]
pub rt_pad4: [c_short; 3usize],
rt_pad4: Padding<[c_short; 3usize]>,
#[cfg(not(target_pointer_width = "64"))]
pub rt_pad4: c_short,
rt_pad4: Padding<c_short>,
pub rt_metric: c_short,
pub rt_dev: *mut c_char,
pub rt_mtu: c_ulong,
Expand Down
6 changes: 3 additions & 3 deletions src/new/linux_uapi/linux/if_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ s! {
pub tp_nsec: u32,
pub tp_vlan_tci: u16,
pub tp_vlan_tpid: u16,
pub tp_padding: [u8; 4],
tp_padding: Padding<[u8; 4]>,
}

pub struct tpacket_hdr_variant1 {
pub tp_rxhash: u32,
pub tp_vlan_tci: u32,
pub tp_vlan_tpid: u16,
pub tp_padding: u16,
tp_padding: Padding<u16>,
}

pub struct tpacket3_hdr {
Expand All @@ -161,7 +161,7 @@ s! {
pub tp_mac: u16,
pub tp_net: u16,
pub hv1: tpacket_hdr_variant1,
pub tp_padding: [u8; 8],
tp_padding: Padding<[u8; 8]>,
}

pub struct tpacket_bd_ts {
Expand Down
4 changes: 2 additions & 2 deletions src/new/musl/sys/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ s! {

pub struct cmsghdr {
#[cfg(all(target_pointer_width = "64", target_endian = "big"))]
pub __pad1: c_int,
__pad1: Padding<c_int>,
pub cmsg_len: crate::socklen_t,
#[cfg(all(target_pointer_width = "64", target_endian = "little"))]
pub __pad1: c_int,
__pad1: Padding<c_int>,
pub cmsg_level: c_int,
pub cmsg_type: c_int,
}
Expand Down
10 changes: 5 additions & 5 deletions src/unix/aix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ s! {
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
pub f_fstr: [c_char; 32],
pub f_filler: [c_ulong; 16],
f_filler: Padding<[c_ulong; 16]>,
}

pub struct lconv {
Expand Down Expand Up @@ -373,7 +373,7 @@ s! {
pub ss_sp: *mut c_void,
pub ss_size: size_t,
pub ss_flags: c_int,
pub __pad: [c_int; 4],
__pad: Padding<[c_int; 4]>,
}

pub struct posix_spawnattr_t {
Expand Down Expand Up @@ -420,9 +420,9 @@ s! {
pub ut_time: time64_t,
pub ut_exit: exit_status,
pub ut_host: [c_char; 256],
pub __dbl_word_pad: c_int,
pub __reservedA: [c_int; 2],
pub __reservedV: [c_int; 6],
__dbl_word_pad: Padding<c_int>,
__reservedA: Padding<[c_int; 2]>,
__reservedV: Padding<[c_int; 6]>,
}

pub struct regmatch_t {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/aix/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ s! {
pub f_flag: c_ulong,
pub f_namemax: c_ulong,
pub f_fstr: [c_char; 32],
pub f_filler: [c_ulong; 16],
f_filler: Padding<[c_ulong; 16]>,
}

pub struct pthread_rwlock_t {
Expand Down
8 changes: 4 additions & 4 deletions src/unix/bsd/apple/b32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ s! {
pub ifi_hdrlen: c_uchar,
pub ifi_recvquota: c_uchar,
pub ifi_xmitquota: c_uchar,
pub ifi_unused1: c_uchar,
ifi_unused1: Padding<c_uchar>,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_baudrate: u32,
Expand All @@ -31,10 +31,10 @@ s! {
pub ifi_recvtiming: u32,
pub ifi_xmittiming: u32,
pub ifi_lastchange: crate::timeval,
pub ifi_unused2: u32,
ifi_unused2: Padding<u32>,
pub ifi_hwassist: u32,
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
ifi_reserved1: Padding<u32>,
ifi_reserved2: Padding<u32>,
}

#[cfg(target_os = "macos")]
Expand Down
8 changes: 4 additions & 4 deletions src/unix/bsd/apple/b64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ s! {
pub ifi_hdrlen: c_uchar,
pub ifi_recvquota: c_uchar,
pub ifi_xmitquota: c_uchar,
pub ifi_unused1: c_uchar,
ifi_unused1: Padding<c_uchar>,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_baudrate: u32,
Expand All @@ -35,10 +35,10 @@ s! {
pub ifi_recvtiming: u32,
pub ifi_xmittiming: u32,
pub ifi_lastchange: timeval32,
pub ifi_unused2: u32,
ifi_unused2: Padding<u32>,
pub ifi_hwassist: u32,
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
ifi_reserved1: Padding<u32>,
ifi_reserved2: Padding<u32>,
}

#[cfg(target_os = "macos")]
Expand Down
44 changes: 22 additions & 22 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ s! {
pub st_blksize: blksize_t,
pub st_flags: u32,
pub st_gen: u32,
pub st_lspare: i32,
pub st_qspare: [i64; 2],
st_lspare: Padding<i32>,
st_qspare: Padding<[i64; 2]>,
}

pub struct siginfo_t {
Expand Down Expand Up @@ -350,10 +350,10 @@ s! {
}

pub struct fpunchhole_t {
pub fp_flags: c_uint, /* unused */
pub reserved: c_uint, /* (to maintain 8-byte alignment) */
pub fp_offset: off_t, /* IN: start of the region */
pub fp_length: off_t, /* IN: size of the region */
pub fp_flags: c_uint, /* unused */
reserved: Padding<c_uint>, /* (to maintain 8-byte alignment) */
pub fp_offset: off_t, /* IN: start of the region */
pub fp_length: off_t, /* IN: size of the region */
}

pub struct ftrimactivefile_t {
Expand All @@ -363,7 +363,7 @@ s! {

pub struct fspecread_t {
pub fsr_flags: c_uint,
pub reserved: c_uint,
reserved: Padding<c_uint>,
pub fsr_offset: off_t,
pub fsr_length: off_t,
}
Expand Down Expand Up @@ -422,7 +422,7 @@ s! {
pub dqb_btime: u32,
pub dqb_itime: u32,
pub dqb_id: u32,
pub dqb_spare: [u32; 4],
dqb_spare: Padding<[u32; 4]>,
}

pub struct if_msghdr {
Expand Down Expand Up @@ -476,7 +476,7 @@ s! {
pub rmx_rtt: u32,
pub rmx_rttvar: u32,
pub rmx_pksent: u32,
pub rmx_filler: [u32; 4],
rmx_filler: Padding<[u32; 4]>,
}

#[cfg(target_os = "macos")]
Expand Down Expand Up @@ -505,7 +505,7 @@ s! {
pub rtm_addrs: c_int,
pub rtm_refcnt: i32,
pub rtm_parentflags: c_int,
pub rtm_reserved: c_int,
rtm_reserved: Padding<c_int>,
pub rtm_use: c_int,
pub rtm_inits: u32,
pub rtm_rmx: rt_metrics,
Expand Down Expand Up @@ -724,7 +724,7 @@ s! {
pub ss_sysaddr: u16,
pub sc_id: u32,
pub sc_unit: u32,
pub sc_reserved: [u32; 5],
sc_reserved: Padding<[u32; 5]>,
}

pub struct in_pktinfo {
Expand Down Expand Up @@ -895,14 +895,14 @@ s! {
pub vst_flags: u32,
pub vst_gen: u32,
pub vst_rdev: u32,
pub vst_qspare: [i64; 2],
vst_qspare: Padding<[i64; 2]>,
}

#[cfg(target_os = "macos")]
pub struct vnode_info {
pub vi_stat: vinfo_stat,
pub vi_type: c_int,
pub vi_pad: c_int,
vi_pad: Padding<c_int>,
pub vi_fsid: crate::fsid_t,
}

Expand Down Expand Up @@ -1074,7 +1074,7 @@ s! {

pub struct attrlist {
pub bitmapcount: c_ushort,
pub reserved: u16,
reserved: Padding<u16>,
pub commonattr: attrgroup_t,
pub volattr: attrgroup_t,
pub dirattr: attrgroup_t,
Expand Down Expand Up @@ -1244,7 +1244,7 @@ s! {
/// Number of drops in send queue
pub ifmd_snd_drops: c_uint,
/// For future expansion
pub ifmd_filler: [c_uint; 4],
ifmd_filler: Padding<[c_uint; 4]>,
/// Generic information and statistics
pub ifmd_data: if_data64,
}
Expand Down Expand Up @@ -1300,10 +1300,10 @@ s! {
pub sem_base: i32,
pub sem_nsems: c_ushort,
pub sem_otime: crate::time_t,
pub sem_pad1: i32,
sem_pad1: Padding<i32>,
pub sem_ctime: crate::time_t,
pub sem_pad2: i32,
pub sem_pad3: [i32; 4],
sem_pad2: Padding<i32>,
sem_pad3: Padding<[i32; 4]>,
}

#[repr(packed(4))]
Expand All @@ -1317,7 +1317,7 @@ s! {
pub shm_dtime: crate::time_t, // FIXME(macos): 64-bit wrong align => wrong offset
pub shm_ctime: crate::time_t, // FIXME(macos): 64-bit wrong align => wrong offset
// FIXME: 64-bit wrong align => wrong offset:
pub shm_internal: *mut c_void,
shm_internal: Padding<*mut c_void>,
}

#[cfg(target_os = "macos")]
Expand Down Expand Up @@ -1352,7 +1352,7 @@ s! {
pub f_mntonname: [c_char; 1024],
pub f_mntfromname: [c_char; 1024],
pub f_flags_ext: u32,
pub f_reserved: [u32; 7],
f_reserved: Padding<[u32; 7]>,
}

pub struct dirent {
Expand Down Expand Up @@ -1473,7 +1473,7 @@ s! {
pub ifi_hdrlen: c_uchar,
pub ifi_recvquota: c_uchar,
pub ifi_xmitquota: c_uchar,
pub ifi_unused1: c_uchar,
ifi_unused1: Padding<c_uchar>,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_baudrate: u64,
Expand Down Expand Up @@ -1598,7 +1598,7 @@ s! {
pub struct sockaddr_vm {
pub svm_len: c_uchar,
pub svm_family: crate::sa_family_t,
pub svm_reserved1: c_ushort,
svm_reserved1: Padding<c_ushort>,
pub svm_port: c_uint,
pub svm_cid: c_uint,
}
Expand Down
Loading