Initial reorg.
This is largely the same as #305, but updated for the current tree.
This commit is contained in:
13
crates/wasi-common/src/macros.rs
Normal file
13
crates/wasi-common/src/macros.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
macro_rules! hostcalls {
|
||||
($(pub unsafe fn $name:ident($($arg:ident: $ty:ty,)*) -> $ret:ty;)*) => ($(
|
||||
#[wasi_common_cbindgen::wasi_common_cbindgen]
|
||||
pub unsafe fn $name($($arg: $ty,)*) -> $ret {
|
||||
let ret = match crate::hostcalls_impl::$name($($arg,)*) {
|
||||
Ok(()) => crate::wasi::__WASI_ESUCCESS,
|
||||
Err(e) => e.as_wasi_errno(),
|
||||
};
|
||||
|
||||
ret
|
||||
}
|
||||
)*)
|
||||
}
|
||||
Reference in New Issue
Block a user