Upgrade to witx 0.8.0 with tagged unions (#921)
* witx tagged unions: updates to wig to use new semantics * wig: emit a `#variant: ()` union variant for empty variants * wasi-common: translate to use tagged unions * update to flattened layout of event struct * wig: generate layout tests, and delete bindgen ones the bindgen tests became out-of-date with the latest changes to the representation of unions, and the re-jiggering of various struct definitions that went along with it. * wasi: point at master with tagged union PR merged * fix event struct repr on windows
This commit is contained in:
@@ -117,745 +117,3 @@ pub fn whence_to_str(whence: __wasi_whence_t) -> &'static str {
|
||||
}
|
||||
|
||||
pub const __WASI_DIRCOOKIE_START: __wasi_dircookie_t = 0;
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout_wasi_dirent_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_dirent_t>(),
|
||||
24usize,
|
||||
concat!("Size of: ", stringify!(__wasi_dirent_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_dirent_t>())).d_next as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_dirent_t),
|
||||
"::",
|
||||
stringify!(d_next)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_dirent_t>())).d_ino as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_dirent_t),
|
||||
"::",
|
||||
stringify!(d_ino)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_dirent_t>())).d_namlen as *const _ as usize },
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_dirent_t),
|
||||
"::",
|
||||
stringify!(d_namlen)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_dirent_t>())).d_type as *const _ as usize },
|
||||
20usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_dirent_t),
|
||||
"::",
|
||||
stringify!(d_type)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout___wasi_event_t___wasi_event_u___wasi_event_u_fd_readwrite_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_event_fd_readwrite_t>(),
|
||||
16usize,
|
||||
concat!("Size of: ", stringify!(__wasi_event_fd_readwrite_t))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<__wasi_event_fd_readwrite_t>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(__wasi_event_fd_readwrite_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_event_fd_readwrite_t>())).nbytes as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_event_fd_readwrite_t),
|
||||
"::",
|
||||
stringify!(nbytes)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_event_fd_readwrite_t>())).flags as *const _ as usize
|
||||
},
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_event_fd_readwrite_t),
|
||||
"::",
|
||||
stringify!(flags)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout___wasi_event_t___wasi_event_u() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_event_u_t>(),
|
||||
16usize,
|
||||
concat!("Size of: ", stringify!(__wasi_event_u_t))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<__wasi_event_u_t>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(__wasi_event_u_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_event_u_t>())).fd_readwrite as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_event_u_t),
|
||||
"::",
|
||||
stringify!(fd_readwrite)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout___wasi_event_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_event_t>(),
|
||||
32usize,
|
||||
concat!("Size of: ", stringify!(__wasi_event_t))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<__wasi_event_t>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(__wasi_event_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_event_t>())).userdata as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_event_t),
|
||||
"::",
|
||||
stringify!(userdata)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_event_t>())).error as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_event_t),
|
||||
"::",
|
||||
stringify!(error)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_event_t>())).r#type as *const _ as usize },
|
||||
10usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_event_t),
|
||||
"::",
|
||||
stringify!(r#type)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_event_t>())).u as *const _ as usize },
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_event_t),
|
||||
"::",
|
||||
stringify!(u)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout_wasi_event_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_event_t>(),
|
||||
32usize,
|
||||
concat!("Size of: ", stringify!(__wasi_event_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_event_t>())).userdata as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_event_t),
|
||||
"::",
|
||||
stringify!(userdata)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_event_t>())).error as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_event_t),
|
||||
"::",
|
||||
stringify!(error)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_event_t>())).r#type as *const _ as usize },
|
||||
10usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_event_t),
|
||||
"::",
|
||||
stringify!(r#type)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout_wasi_fdstat_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_fdstat_t>(),
|
||||
24usize,
|
||||
concat!("Size of: ", stringify!(__wasi_fdstat_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_fdstat_t>())).fs_filetype as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_fdstat_t),
|
||||
"::",
|
||||
stringify!(fs_filetype)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_fdstat_t>())).fs_flags as *const _ as usize },
|
||||
2usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_fdstat_t),
|
||||
"::",
|
||||
stringify!(fs_flags)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_fdstat_t>())).fs_rights_base as *const _ as usize
|
||||
},
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_fdstat_t),
|
||||
"::",
|
||||
stringify!(fs_rights_base)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_fdstat_t>())).fs_rights_inheriting as *const _
|
||||
as usize
|
||||
},
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_fdstat_t),
|
||||
"::",
|
||||
stringify!(fs_rights_inheriting)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout_wasi_filestat_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_filestat_t>(),
|
||||
64usize,
|
||||
concat!("Size of: ", stringify!(__wasi_filestat_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).dev as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_dev)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).ino as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_ino)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).filetype as *const _ as usize },
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_filetype)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).nlink as *const _ as usize },
|
||||
24usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_nlink)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).size as *const _ as usize },
|
||||
32usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_size)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).atim as *const _ as usize },
|
||||
40usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_atim)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).mtim as *const _ as usize },
|
||||
48usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_mtim)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).ctim as *const _ as usize },
|
||||
56usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_ctim)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout___wasi_subscription_clock_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_subscription_clock_t>(),
|
||||
32usize,
|
||||
concat!("Size of: ", stringify!(__wasi_subscription_clock_t))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<__wasi_subscription_clock_t>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(__wasi_subscription_clock_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_subscription_clock_t>())).id as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_subscription_clock_t),
|
||||
"::",
|
||||
stringify!(clock_id)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_subscription_clock_t>())).timeout as *const _ as usize
|
||||
},
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_subscription_clock_t),
|
||||
"::",
|
||||
stringify!(timeout)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_subscription_clock_t>())).precision as *const _
|
||||
as usize
|
||||
},
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_subscription_clock_t),
|
||||
"::",
|
||||
stringify!(precision)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_subscription_clock_t>())).flags as *const _ as usize
|
||||
},
|
||||
24usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_subscription_clock_t),
|
||||
"::",
|
||||
stringify!(flags)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout___wasi_subscription_t___wasi_subscription_u___wasi_subscription_u_fd_readwrite_t(
|
||||
) {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_subscription_fd_readwrite_t>(),
|
||||
4usize,
|
||||
concat!("Size of: ", stringify!(__wasi_subscription_fd_readwrite_t))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<__wasi_subscription_fd_readwrite_t>(),
|
||||
4usize,
|
||||
concat!(
|
||||
"Alignment of ",
|
||||
stringify!(__wasi_subscription_fd_readwrite_t)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_subscription_fd_readwrite_t>())).file_descriptor
|
||||
as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_subscription_fd_readwrite_t),
|
||||
"::",
|
||||
stringify!(fd)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout___wasi_subscription_t___wasi_subscription_u() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_subscription_u_t>(),
|
||||
32usize,
|
||||
concat!("Size of: ", stringify!(__wasi_subscription_u_t))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<__wasi_subscription_u_t>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(__wasi_subscription_u_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_subscription_u_t>())).clock as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_subscription_u_t),
|
||||
"::",
|
||||
stringify!(clock)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_subscription_u_t>())).fd_readwrite as *const _
|
||||
as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_subscription_u_t),
|
||||
"::",
|
||||
stringify!(fd_readwrite)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout___wasi_subscription_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_subscription_t>(),
|
||||
48usize,
|
||||
concat!("Size of: ", stringify!(__wasi_subscription_t))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<__wasi_subscription_t>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(__wasi_subscription_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_subscription_t>())).userdata as *const _ as usize
|
||||
},
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_subscription_t),
|
||||
"::",
|
||||
stringify!(userdata)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_subscription_t>())).r#type as *const _ as usize
|
||||
},
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_subscription_t),
|
||||
"::",
|
||||
stringify!(r#type)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_subscription_t>())).u as *const _ as usize },
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_subscription_t),
|
||||
"::",
|
||||
stringify!(u)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout___wasi_filestat_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_filestat_t>(),
|
||||
64usize,
|
||||
concat!("Size of: ", stringify!(__wasi_filestat_t))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<__wasi_filestat_t>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(__wasi_filestat_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).dev as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_dev)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).ino as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_ino)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).filetype as *const _ as usize },
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_filetype)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).nlink as *const _ as usize },
|
||||
24usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_nlink)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).size as *const _ as usize },
|
||||
32usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_size)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).atim as *const _ as usize },
|
||||
40usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_atim)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).mtim as *const _ as usize },
|
||||
48usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_mtim)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_filestat_t>())).ctim as *const _ as usize },
|
||||
56usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_filestat_t),
|
||||
"::",
|
||||
stringify!(st_ctim)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout___wasi_fdstat_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_fdstat_t>(),
|
||||
24usize,
|
||||
concat!("Size of: ", stringify!(__wasi_fdstat_t))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<__wasi_fdstat_t>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(__wasi_fdstat_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_fdstat_t>())).fs_filetype as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_fdstat_t),
|
||||
"::",
|
||||
stringify!(fs_filetype)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_fdstat_t>())).fs_flags as *const _ as usize },
|
||||
2usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_fdstat_t),
|
||||
"::",
|
||||
stringify!(fs_flags)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_fdstat_t>())).fs_rights_base as *const _ as usize
|
||||
},
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_fdstat_t),
|
||||
"::",
|
||||
stringify!(fs_rights_base)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe {
|
||||
&(*(::std::ptr::null::<__wasi_fdstat_t>())).fs_rights_inheriting as *const _
|
||||
as usize
|
||||
},
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_fdstat_t),
|
||||
"::",
|
||||
stringify!(fs_rights_inheriting)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bindgen_test_layout___wasi_dirent_t() {
|
||||
assert_eq!(
|
||||
::std::mem::size_of::<__wasi_dirent_t>(),
|
||||
24usize,
|
||||
concat!("Size of: ", stringify!(__wasi_dirent_t))
|
||||
);
|
||||
assert_eq!(
|
||||
::std::mem::align_of::<__wasi_dirent_t>(),
|
||||
8usize,
|
||||
concat!("Alignment of ", stringify!(__wasi_dirent_t))
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_dirent_t>())).d_next as *const _ as usize },
|
||||
0usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_dirent_t),
|
||||
"::",
|
||||
stringify!(d_next)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_dirent_t>())).d_ino as *const _ as usize },
|
||||
8usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_dirent_t),
|
||||
"::",
|
||||
stringify!(d_ino)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_dirent_t>())).d_namlen as *const _ as usize },
|
||||
16usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_dirent_t),
|
||||
"::",
|
||||
stringify!(d_namlen)
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
unsafe { &(*(::std::ptr::null::<__wasi_dirent_t>())).d_type as *const _ as usize },
|
||||
20usize,
|
||||
concat!(
|
||||
"Offset of field: ",
|
||||
stringify!(__wasi_dirent_t),
|
||||
"::",
|
||||
stringify!(d_type)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user