Skip to content

Commit

Permalink
update checked macro
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermebodin committed May 30, 2023
1 parent aea1a3a commit 6432567
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ macro checked(expr)
@assert ( expr.args[1].head == :(.) ) && ( expr.args[1].args[1] == :Lib) "Can only use @checked on Lib.\$function"
@assert length(expr.args) >= 2 "Lib.\$function must be contain atleast one argument and the first argument must be of type XpressProblem"
f = replace(String(expr.args[1].args[2].value), "XPRS" => "")
return esc(quote
r = $(expr)::Cint
_check($(expr.args[2]), r)::Nothing
end)
return quote
r = $(esc(expr))::Cint
_check($(esc(expr.args[2])), r)::Nothing
end
end

function _check(prob, val::Cint)
Expand Down

0 comments on commit 6432567

Please sign in to comment.