Skip to content

Commit d92f2ff

Browse files
committed
add nothrow variant of jl_get_library
1 parent 608567f commit d92f2ff

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/julia_internal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,8 @@ extern void *jl_crtdll_handle;
861861
extern void *jl_winsock_handle;
862862
#endif
863863

864-
void *jl_get_library(const char *f_lib);
864+
void *jl_get_library_(const char *f_lib, int throw_err);
865+
#define jl_get_library(f_lib) jl_get_library_(f_lib, 1)
865866
JL_DLLEXPORT void *jl_load_and_lookup(const char *f_lib, const char *f_name,
866867
void **hnd);
867868
JL_DLLEXPORT jl_value_t *jl_get_cfunction_trampoline(

src/runtime_ccall.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using namespace llvm;
2727
static std::map<std::string, void*> libMap;
2828
static jl_mutex_t libmap_lock;
2929
extern "C"
30-
void *jl_get_library(const char *f_lib)
30+
void *jl_get_library_(const char *f_lib, int throw_err)
3131
{
3232
void *hnd;
3333
#ifdef _OS_WINDOWS_
@@ -47,7 +47,7 @@ void *jl_get_library(const char *f_lib)
4747
if (hnd != NULL)
4848
return hnd;
4949
// We might run this concurrently on two threads but it doesn't matter.
50-
hnd = jl_load_dynamic_library(f_lib, JL_RTLD_DEFAULT, 1);
50+
hnd = jl_load_dynamic_library(f_lib, JL_RTLD_DEFAULT, throw_err);
5151
if (hnd != NULL)
5252
jl_atomic_store_release(map_slot, hnd);
5353
return hnd;

0 commit comments

Comments
 (0)