more explicit name for callback type from dlsym

This commit is contained in:
Dane Springmeyer 2016-04-05 15:31:19 -04:00
parent f8a8ec616a
commit 61cb4effb8
2 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ using mapnik_lib_t = struct _mapnik_lib_t;
class PluginInfo : util::noncopyable
{
public:
using name_func = const char* (*) ();
using callable_returning_string = const char* (*) ();
PluginInfo (std::string const& filename,
std::string const& library_name);
~PluginInfo();

View file

@ -58,7 +58,7 @@ PluginInfo::PluginInfo(std::string const& filename,
if (module_) module_->dl = LoadLibraryA(filename.c_str());
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();
}
#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)
{
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();
}
#else