From bf77c8234d43e1a8e048e8fb1e4b19cca7ca04a4 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Thu, 12 Sep 2024 14:18:54 +0330 Subject: [PATCH] fix style issue --- src/wasi/mod.rs | 17 +++++++++++++++-- src/wasi/wasix.rs | 10 +--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/wasi/mod.rs b/src/wasi/mod.rs index 9d17b86e5191..af79c900b168 100644 --- a/src/wasi/mod.rs +++ b/src/wasi/mod.rs @@ -31,8 +31,21 @@ pub type time_t = c_longlong; pub type c_double = f64; pub type c_float = f32; pub type ino_t = u64; -#[cfg(not(target_vendor = "wasmer"))] -pub type sigset_t = c_uchar; +cfg_if! { + if #[cfg(target_vendor = "wasmer")] { + s! { + #[repr(C)] + pub struct sigset_t { + #[cfg(target_pointer_width = "32")] + __val: [u32; 2], + #[cfg(target_pointer_width = "64")] + __val: [u64; 1], + } + } + } else { + pub type sigset_t = c_uchar; + } +} pub type suseconds_t = c_longlong; pub type mode_t = u32; pub type dev_t = u64; diff --git a/src/wasi/wasix.rs b/src/wasi/wasix.rs index a5d170516014..459317e62ce9 100644 --- a/src/wasi/wasix.rs +++ b/src/wasi/wasix.rs @@ -209,14 +209,6 @@ s! { __size: [u64; 7], } - #[repr(C)] - pub struct sigset_t { - #[cfg(target_pointer_width = "32")] - __val: [u32; 2], - #[cfg(target_pointer_width = "64")] - __val: [u64; 1], - } - #[repr(C)] pub struct siginfo_t { pub si_signo: ::c_int, @@ -1031,4 +1023,4 @@ pub fn W_STOPCODE(sig: ::c_int) -> ::c_int { pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int { (cmd << 8) | (type_ & 0x00ff) -} \ No newline at end of file +}