Skip to content

Commit

Permalink
Update Mex.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
taylormcd authored Nov 2, 2021
1 parent a028a24 commit 03e2773
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Mex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ const ut_is_interrupt_pending = Ref{Ptr{Cvoid}}()

function __init__()

libmex[] = Libdl.dlopen(joinpath(MATLAB.matlab_libpath, "libmex"), Libdl.RTLD_GLOBAL; throw_error=false)
mex_call_matlab_with_trap[] = Libdl.dlsym(libmex[], :mexCallMATLABWithTrap; throw_error=false)
result = Libdl.dlopen(joinpath(MATLAB.matlab_libpath, "libmex"), Libdl.RTLD_GLOBAL; throw_error=false)
if !isnothing(result)
libmex[] = result
mex_call_matlab_with_trap[] = Libdl.dlsym(libmex[], :mexCallMATLABWithTrap)
end

libut[] = Libdl.dlopen(joinpath(MATLAB.matlab_libpath, "libut"), Libdl.RTLD_GLOBAL; throw_error=false)
ut_is_interrupt_pending[] = Libdl.dlsym(libut[], :utIsInterruptPending; throw_error=false)
result = Libdl.dlopen(joinpath(MATLAB.matlab_libpath, "libut"), Libdl.RTLD_GLOBAL; throw_error=false)
if !isnothing(result)
libut[] = result
ut_is_interrupt_pending[] = Libdl.dlsym(libut[], :utIsInterruptPending)
end

end

# --- Patches --- #
Expand Down

0 comments on commit 03e2773

Please sign in to comment.