1
0
mirror of synced 2025-01-18 00:56:49 +01:00

fix: Linux build issues

This commit is contained in:
WerWolv 2024-03-14 17:49:04 +01:00
parent 47e7e80afe
commit cf320266df
2 changed files with 9 additions and 3 deletions

View File

@ -49,7 +49,9 @@ namespace hex {
}
#else
if (handle != 0) {
dlclose(reinterpret_cast<void*>(handle));
if (dlclose(reinterpret_cast<void*>(handle)) != 0) {
log::error("Error when unloading library '{}': {}!", path.filename().string(), dlerror());
}
}
#endif
}

View File

@ -86,7 +86,7 @@ namespace hex::script::loader {
bool loadHostfxr() {
#if defined(OS_WINDOWS)
auto netHostLibrary = loadLibrary(L"nethost.dll");
#elif defined(OS_LINUX)
#elif defined(OS_LINUX)
auto netHostLibrary = loadLibrary("libnethost.so");
#elif defined(OS_MACOS)
void *netHostLibrary = nullptr;
@ -162,7 +162,11 @@ namespace hex::script::loader {
throw std::runtime_error(hex::format("Failed to initialize command line {:X}", result));
}
hostfxr_set_runtime_property_value(ctx, STRING("PINVOKE_OVERRIDE"), utf8ToUtf16(hex::format("{}", (void*)pInvokeOverride)).c_str());
#if defined (OS_WINDOWS)
hostfxr_set_runtime_property_value(ctx, STRING("PINVOKE_OVERRIDE"), utf8ToUtf16(hex::format("{}", (void*)pInvokeOverride)).c_str());
#else
hostfxr_set_runtime_property_value(ctx, STRING("PINVOKE_OVERRIDE"), hex::format("{}", (void*)pInvokeOverride).c_str());
#endif
result = hostfxr_get_runtime_delegate(
ctx,