|
// defined in wasi-libc |
|
// https://github.com/WebAssembly/wasi-libc/blob/a6f871343313220b76009827ed0153586361c0d5/libc-top-half/musl/include/alltypes.h.in#L108 |
|
#[repr(C)] |
|
union pthread_attr_union { |
|
__i: [ffi::c_int; if mem::size_of::<ffi::c_int>() == 8 { 14 } else { 9 }], |
|
__vi: [ffi::c_int; if mem::size_of::<ffi::c_int>() == 8 { 14 } else { 9 }], |
|
__s: [ffi::c_ulong; if mem::size_of::<ffi::c_int>() == 8 { 7 } else { 9 }], |
|
} |
the type which should have its size compared is c_long, not c_int:
wasi-libc's code linked in comment above:
TYPEDEF struct { union { int __i[sizeof(long)==8?14:9]; volatile int __vi[sizeof(long)==8?14:9]; unsigned long __s[sizeof(long)==8?7:9]; } __u; } pthread_attr_t;
since you made the commit, cc @g0djan
rust/library/std/src/sys/wasi/thread.rs
Lines 19 to 26 in 5697f16
the type which should have its size compared is
c_long, notc_int:wasi-libc's code linked in comment above:
since you made the commit, cc @g0djan