fix: update dll loader
This commit is contained in:
@@ -13,8 +13,7 @@ namespace Basalt::Presenter {
|
||||
#else
|
||||
m_Handle = dlopen(filename.data(), RTLD_LAZY);
|
||||
#endif
|
||||
if (!m_Handle)
|
||||
throw std::runtime_error("can not load given dynamic library.");
|
||||
if (!m_Handle) throw std::runtime_error("Can not load given dynamic library.");
|
||||
}
|
||||
|
||||
DllLoader::~DllLoader() {
|
||||
@@ -27,4 +26,13 @@ namespace Basalt::Presenter {
|
||||
}
|
||||
}
|
||||
|
||||
void *DllLoader::GetFunctionPointer(const char *name) {
|
||||
if (!m_Handle) throw std::runtime_error("Can not fetch function pointer on not loaded dynamic library.");
|
||||
#if defined(BASALT_OS_WINDOWS)
|
||||
return (void *) GetProcAddress(m_Handle, name);
|
||||
#else
|
||||
return (void *) dlsym(m_Handle, name);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Basalt::Presenter
|
||||
|
||||
Reference in New Issue
Block a user