Skip to content

Commit

Permalink
fix: Order of all s_*! macro calls
Browse files Browse the repository at this point in the history
  • Loading branch information
flba-eb committed Oct 28, 2022
1 parent 31693b7 commit 60b655d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 48 deletions.
22 changes: 11 additions & 11 deletions src/unix/bsd/freebsdlike/freebsd/aarch64.rs
Expand Up @@ -6,17 +6,6 @@ pub type time_t = i64;
pub type suseconds_t = i64;
pub type register_t = i64;

// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}

s_no_extra_traits! {
pub struct gpregs {
pub gp_x: [::register_t; 30],
Expand Down Expand Up @@ -44,6 +33,17 @@ s_no_extra_traits! {
}
}

// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}

cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for gpregs {
Expand Down
22 changes: 11 additions & 11 deletions src/unix/bsd/freebsdlike/freebsd/riscv64.rs
Expand Up @@ -6,17 +6,6 @@ pub type time_t = i64;
pub type suseconds_t = ::c_long;
pub type register_t = i64;

// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}

s_no_extra_traits! {
pub struct gpregs {
pub gp_ra: ::register_t,
Expand Down Expand Up @@ -46,6 +35,17 @@ s_no_extra_traits! {
}
}

// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}

cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for gpregs {
Expand Down
48 changes: 24 additions & 24 deletions src/unix/solarish/solaris.rs
Expand Up @@ -26,6 +26,30 @@ s! {
}
}

s_no_extra_traits! {
#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub union door_desc_t__d_data {
pub d_desc: door_desc_t__d_data__d_desc,
d_resv: [::c_int; 5], /* Check out /usr/include/sys/door.h */
}

#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub struct door_desc_t {
pub d_attributes: door_attr_t,
pub d_data: door_desc_t__d_data,
}

#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub struct door_arg_t {
pub data_ptr: *const ::c_char,
pub data_size: ::size_t,
pub desc_ptr: *const door_desc_t,
pub dec_num: ::c_uint,
pub rbuf: *const ::c_char,
pub rsize: ::size_t,
}
}

pub const PORT_SOURCE_POSTWAIT: ::c_int = 8;
pub const PORT_SOURCE_SIGNAL: ::c_int = 9;

Expand Down Expand Up @@ -75,27 +99,3 @@ extern "C" {

pub fn euidaccess(path: *const ::c_char, amode: ::c_int) -> ::c_int;
}

s_no_extra_traits! {
#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub union door_desc_t__d_data {
pub d_desc: door_desc_t__d_data__d_desc,
d_resv: [::c_int; 5], /* Check out /usr/include/sys/door.h */
}

#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub struct door_desc_t {
pub d_attributes: door_attr_t,
pub d_data: door_desc_t__d_data,
}

#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub struct door_arg_t {
pub data_ptr: *const ::c_char,
pub data_size: ::size_t,
pub desc_ptr: *const door_desc_t,
pub dec_num: ::c_uint,
pub rbuf: *const ::c_char,
pub rsize: ::size_t,
}
}
3 changes: 1 addition & 2 deletions src/wasi.rs
Expand Up @@ -39,6 +39,7 @@ pub type blkcnt_t = i64;
pub type nfds_t = c_ulong;
pub type wchar_t = i32;
pub type nl_item = c_int;
pub type __wasi_rights_t = u64;

s_no_extra_traits! {
#[repr(align(16))]
Expand All @@ -48,8 +49,6 @@ s_no_extra_traits! {
}
}

pub type __wasi_rights_t = u64;

#[allow(missing_copy_implementations)]
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
Expand Down

0 comments on commit 60b655d

Please sign in to comment.