mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-14 20:12:29 -04:00
PluginManager:
Fixed compile under Windows. Removed CloseHandle of GetModuleHandle. Added missing return when the function entry of the plugin is NULL. Fixed checking for the extension ".dll". git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4287 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6e633e419a
commit
ce90ea4495
2 changed files with 11 additions and 9 deletions
|
@ -39,7 +39,7 @@ bool RsPluginManager::acceptablePluginName(const std::string& name)
|
|||
// Needs some windows specific code here
|
||||
//
|
||||
#ifdef WINDOWS_SYS
|
||||
return name.size() > 4 && !strcmp(name.c_str()+name.size()-3,".dll") ;
|
||||
return name.size() > 4 && name.substr(name.size() - 4) == ".dll";
|
||||
#else
|
||||
return name.size() > 3 && !strcmp(name.c_str()+name.size()-3,".so") ;
|
||||
#endif
|
||||
|
@ -106,10 +106,11 @@ bool RsPluginManager::loadPlugin(const std::string& plugin_name)
|
|||
|
||||
void *pf = dlsym(handle,_plugin_entry_symbol.c_str()) ;
|
||||
|
||||
if(pf == NULL)
|
||||
if(pf == NULL) {
|
||||
std::cerr << dlerror() << std::endl ;
|
||||
else
|
||||
std::cerr << " Added function entry for symbol " << _plugin_entry_symbol << std::endl ;
|
||||
return false ;
|
||||
}
|
||||
std::cerr << " Added function entry for symbol " << _plugin_entry_symbol << std::endl ;
|
||||
|
||||
RsPlugin *p = ( (*(RetroSharePluginEntry)pf)() ) ;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue