1
0
mirror of synced 2024-09-24 03:28:24 +02:00

fix: Unix build issues with dladdr

This commit is contained in:
WerWolv 2024-03-13 08:38:40 +01:00
parent fdf01dfb50
commit 3798654f92
2 changed files with 3 additions and 4 deletions

View File

@ -795,8 +795,8 @@ namespace hex {
return nullptr;
#elif !defined(OS_WEB)
Dl_info info;
if (dladdr(symbol, nullptr) == 0)
Dl_info info = {};
if (dladdr(symbol, &info) == 0)
return nullptr;
return dlopen(info.dli_fname, RTLD_LAZY);

View File

@ -77,8 +77,7 @@ namespace hex::script::loader {
if (library == "cimgui") {
return getExport<void*>(ImHexApi::System::getLibImHexModuleHandle(), symbolName);
} else if (library == "ImHex") {
auto address = getExport<void*>(hex::getContainingModule((void*)&pInvokeOverride), symbolName);
return address;
return getExport<void*>(hex::getContainingModule((void*)&pInvokeOverride), symbolName);
}
return nullptr;