add dlerror() call wrapper
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
||||
@ -133,6 +133,16 @@ namespace platform {
|
||||
|
||||
void *dlopen(const std::string &fname);
|
||||
|
||||
/*! Obtain error diagnostic info after dynamic linking function calls
|
||||
*
|
||||
* Return a human-readable string describing the most recent error that
|
||||
* occurred when using one of the functions for dynamic loading objects
|
||||
* the last call to this function. The string is empty, if there was no error.
|
||||
*
|
||||
* \return string with error message or empty */
|
||||
|
||||
std::string dlerror();
|
||||
|
||||
/*! Close a shared object
|
||||
*
|
||||
* This releases the object corresponding to the provided handle.
|
||||
|
||||
Reference in New Issue
Block a user