Skip to content

Commit bf77c82

Browse files
committed
fix style issue
1 parent 58c6400 commit bf77c82

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

src/wasi/mod.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,21 @@ pub type time_t = c_longlong;
3131
pub type c_double = f64;
3232
pub type c_float = f32;
3333
pub type ino_t = u64;
34-
#[cfg(not(target_vendor = "wasmer"))]
35-
pub type sigset_t = c_uchar;
34+
cfg_if! {
35+
if #[cfg(target_vendor = "wasmer")] {
36+
s! {
37+
#[repr(C)]
38+
pub struct sigset_t {
39+
#[cfg(target_pointer_width = "32")]
40+
__val: [u32; 2],
41+
#[cfg(target_pointer_width = "64")]
42+
__val: [u64; 1],
43+
}
44+
}
45+
} else {
46+
pub type sigset_t = c_uchar;
47+
}
48+
}
3649
pub type suseconds_t = c_longlong;
3750
pub type mode_t = u32;
3851
pub type dev_t = u64;

src/wasi/wasix.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,6 @@ s! {
209209
__size: [u64; 7],
210210
}
211211

212-
#[repr(C)]
213-
pub struct sigset_t {
214-
#[cfg(target_pointer_width = "32")]
215-
__val: [u32; 2],
216-
#[cfg(target_pointer_width = "64")]
217-
__val: [u64; 1],
218-
}
219-
220212
#[repr(C)]
221213
pub struct siginfo_t {
222214
pub si_signo: ::c_int,
@@ -1031,4 +1023,4 @@ pub fn W_STOPCODE(sig: ::c_int) -> ::c_int {
10311023

10321024
pub fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
10331025
(cmd << 8) | (type_ & 0x00ff)
1034-
}
1026+
}

0 commit comments

Comments
 (0)