Let native callbacks be defined in shared libraries on *nix platforms.

This commit is contained in:
Andy Fillebrown 2019-04-10 10:59:58 -04:00
parent 074ff2a093
commit 5efb489fc6

View file

@ -27,7 +27,8 @@ static void* getExportedFunction(const char* symbolName) {
FARPROC symbol = GetProcAddress(library, symbolName);
return (void*)symbol;
#else
void* dll = dlopen(nullptr, RTLD_LAZY);
void* dll = dlopen(nativeModule.isNull() || nativeModule.isEmpty() ? nullptr : nativeModule.toLocal8Bit(),
RTLD_LAZY);
void* result = dlsym(dll, symbolName);
dlclose(dll);
return result;