Skip to content

Commit 9687509

Browse files
committed
Do not attempt to load ndll when the name is empty
1 parent 54af892 commit 9687509

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/hx/Lib.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,25 @@ extern "C" void *hx_cffi(const char *inName);
503503

504504
void *__hxcpp_get_proc_address(String inLib, String full_name,bool inNdllProc,bool inQuietFail)
505505
{
506+
if (inLib.length==0)
507+
{
508+
if (sgRegisteredPrims)
509+
{
510+
void *registered = (*sgRegisteredPrims)[full_name.__CStr()];
511+
if (registered)
512+
return registered;
513+
}
514+
if (!inQuietFail)
515+
{
516+
#ifdef ANDROID
517+
__android_log_print(ANDROID_LOG_ERROR, "loader", "Could not find primitive %s in static link", full_name.__CStr());
518+
#else
519+
fprintf(stderr,"Could not find primitive %s in static link.\n", full_name.__CStr());
520+
#endif
521+
}
522+
return nullptr;
523+
}
524+
506525
String bin = __hxcpp_get_bin_dir();
507526
String deviceExt = __hxcpp_get_dll_extension();
508527

0 commit comments

Comments
 (0)