mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 13:48:26 +00:00
Merge branch 'master' into feat-c-api-wasi-unordered-imports
This commit is contained in:
@@ -467,16 +467,19 @@ macro_rules! wasm_declare_own {
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! c_try {
|
||||
($expr:expr) => {{
|
||||
($expr:expr; otherwise $return:expr) => {{
|
||||
let res: Result<_, _> = $expr;
|
||||
match res {
|
||||
Ok(val) => val,
|
||||
Err(err) => {
|
||||
crate::error::update_last_error(err);
|
||||
return None;
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
}};
|
||||
($expr:expr) => {{
|
||||
c_try!($expr; otherwise None)
|
||||
}};
|
||||
($expr:expr, $e:expr) => {{
|
||||
let opt: Option<_> = $expr;
|
||||
c_try!(opt.ok_or_else(|| $e))
|
||||
|
||||
Reference in New Issue
Block a user