add dlerror() call wrapper

This commit is contained in:
Axel Kohlmeyer
2021-10-06 08:45:56 -04:00
parent 7801d112b3
commit 10a8a1b325
3 changed files with 29 additions and 0 deletions

View File

@ -507,6 +507,13 @@ void *platform::dlopen(const std::string &fname)
return (void *) LoadLibrary(fname.c_str());
}
// return dynamic linker error string
std::string platform::dlerror()
{
return "";
}
// close a shared object
int platform::dlclose(void *handle)
{
@ -528,6 +535,15 @@ void *platform::dlopen(const std::string &fname)
return ::dlopen(fname.c_str(), RTLD_NOW | RTLD_GLOBAL);
}
// return dynamic linker error string
std::string platform::dlerror()
{
const char *errmesg = ::dlerror();
if (errmesg) return std::string(errmesg);
else return "";
}
// close a shared object
int platform::dlclose(void *handle)
{