check_call_opt_key: [] -> ()
(cherry picked from commit 76966c24dcf6413a4ebdfe0ddba00e3d1d7e5fff)
This commit is contained in:
parent
cc2e640e7f
commit
c235b32868
2 changed files with 4 additions and 4 deletions
|
|
@ -105,10 +105,10 @@ pub use check_call;
|
|||
// TODO: Generalize this macro to work with any error code or any error handling logic
|
||||
#[macro_export]
|
||||
macro_rules! check_call_opt_key {
|
||||
($f:path[$ctx:expr, $($arg:expr),*]) => {
|
||||
($($f:ident)::+($ctx:expr, $($arg:expr),*)) => {
|
||||
{
|
||||
let ctx : &mut $crate::context::Context = $ctx;
|
||||
let ret = $f(ctx.ptr(), $($arg,)*);
|
||||
let ret = $($f)::*(ctx.ptr(), $($arg,)*);
|
||||
if unsafe { raw::err_code(ctx.ptr()) == raw::NIX_ERR_KEY } {
|
||||
ctx.clear();
|
||||
return Ok(None);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue