more explicit name for callback type from dlsym
This commit is contained in:
parent
f8a8ec616a
commit
61cb4effb8
2 changed files with 3 additions and 3 deletions
|
@ -38,7 +38,7 @@ using mapnik_lib_t = struct _mapnik_lib_t;
|
||||||
class PluginInfo : util::noncopyable
|
class PluginInfo : util::noncopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using name_func = const char* (*) ();
|
using callable_returning_string = const char* (*) ();
|
||||||
PluginInfo (std::string const& filename,
|
PluginInfo (std::string const& filename,
|
||||||
std::string const& library_name);
|
std::string const& library_name);
|
||||||
~PluginInfo();
|
~PluginInfo();
|
||||||
|
|
|
@ -58,7 +58,7 @@ PluginInfo::PluginInfo(std::string const& filename,
|
||||||
if (module_) module_->dl = LoadLibraryA(filename.c_str());
|
if (module_) module_->dl = LoadLibraryA(filename.c_str());
|
||||||
if (module_ && module_->dl)
|
if (module_ && module_->dl)
|
||||||
{
|
{
|
||||||
name_func name = reinterpret_cast<name_func>(dlsym(module_->dl, library_name.c_str()));
|
callable_returning_string name = reinterpret_cast<callable_returning_string>(dlsym(module_->dl, library_name.c_str()));
|
||||||
if (name) name_ = name();
|
if (name) name_ = name();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -66,7 +66,7 @@ PluginInfo::PluginInfo(std::string const& filename,
|
||||||
if (module_) module_->dl = dlopen(filename.c_str(),RTLD_LAZY);
|
if (module_) module_->dl = dlopen(filename.c_str(),RTLD_LAZY);
|
||||||
if (module_ && module_->dl)
|
if (module_ && module_->dl)
|
||||||
{
|
{
|
||||||
name_func name = reinterpret_cast<name_func>(dlsym(module_->dl, library_name.c_str()));
|
callable_returning_string name = reinterpret_cast<callable_returning_string>(dlsym(module_->dl, library_name.c_str()));
|
||||||
if (name) name_ = name();
|
if (name) name_ = name();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue