diff --git a/src/teeos/mod.rs b/src/teeos/mod.rs index b055d2aca8c7e..1ec2706cfdf76 100644 --- a/src/teeos/mod.rs +++ b/src/teeos/mod.rs @@ -51,9 +51,6 @@ pub type c_long = i64; pub type c_ulong = u64; -#[repr(align(16))] -pub struct _CLongDouble(pub u128); - // long double in C means A float point value, which has 128bit length. // but some bit maybe not used, so the real length of long double could be 80(x86) or 128(power pc/IEEE) // this is different from f128(not stable and not included default) in Rust, so we use u128 for FFI(Rust to C). @@ -88,6 +85,9 @@ pub type wctype_t = c_ulong; pub type cmpfunc = extern "C" fn(x: *const c_void, y: *const c_void) -> c_int; +#[repr(align(16))] +pub struct _CLongDouble(pub u128); + #[repr(align(8))] #[repr(C)] pub struct pthread_cond_t { diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 88d39c6316a40..c2fa6392fa500 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -2162,18 +2162,6 @@ cfg_if! { } } -cfg_if! { - if #[cfg(all( - any(target_env = "gnu", target_env = "musl", target_env = "ohos"), - any(target_arch = "x86_64", target_arch = "x86") - ))] { - extern "C" { - pub fn iopl(level: c_int) -> c_int; - pub fn ioperm(from: c_ulong, num: c_ulong, turn_on: c_int) -> c_int; - } - } -} - cfg_if! { if #[cfg(any( target_env = "gnu", @@ -6007,6 +5995,18 @@ safe_f! { } } +cfg_if! { + if #[cfg(all( + any(target_env = "gnu", target_env = "musl", target_env = "ohos"), + any(target_arch = "x86_64", target_arch = "x86") + ))] { + extern "C" { + pub fn iopl(level: c_int) -> c_int; + pub fn ioperm(from: c_ulong, num: c_ulong, turn_on: c_int) -> c_int; + } + } +} + cfg_if! { if #[cfg(all(not(target_env = "uclibc"), not(target_env = "ohos")))] { extern "C" { diff --git a/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs b/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs index 7e1499a1fd8bd..b108e77c7cd32 100644 --- a/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs +++ b/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs @@ -28,7 +28,6 @@ s! { } } -#[cfg(target_os = "l4re")] #[allow(missing_debug_implementations)] pub struct pthread_attr_t { pub __detachstate: c_int, diff --git a/src/wasi/mod.rs b/src/wasi/mod.rs index 909b33a20ac77..f2b774ea51549 100644 --- a/src/wasi/mod.rs +++ b/src/wasi/mod.rs @@ -44,6 +44,7 @@ pub type nfds_t = c_ulong; pub type wchar_t = i32; pub type nl_item = c_int; pub type __wasi_rights_t = u64; +pub type locale_t = *mut __locale_struct; s_no_extra_traits! { #[repr(align(16))] @@ -63,8 +64,6 @@ pub enum DIR {} #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum __locale_struct {} -pub type locale_t = *mut __locale_struct; - s_paren! { // in wasi-libc clockid_t is const struct __clockid* (where __clockid is an opaque struct), // but that's an implementation detail that we don't want to have to deal with