From 325ee09f8fa61185efd6ec8b64b6432686170ac8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 20 May 2009 20:04:09 +0200 Subject: Module wieder heil-gebastelt --- src/Common/ModuleManager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Common/ModuleManager.cpp') diff --git a/src/Common/ModuleManager.cpp b/src/Common/ModuleManager.cpp index 569f5aa..05a2b73 100644 --- a/src/Common/ModuleManager.cpp +++ b/src/Common/ModuleManager.cpp @@ -17,6 +17,9 @@ * with this program. If not, see . */ + +#include + #include "ModuleManager.h" #include "ConfigEntry.h" @@ -73,7 +76,7 @@ lt_dlhandle ModuleManager::loadModule(const std::string &name) { std::map >::iterator mod = modules.find(name); if(mod == modules.end()) { - lt_dlhandle handle = lt_dlopen((name + ".la").c_str()); + lt_dlhandle handle = lt_dlopen((name + MODULE_SUFFIX).c_str()); if(!handle) return 0; @@ -81,7 +84,7 @@ lt_dlhandle ModuleManager::loadModule(const std::string &name) { mod = modules.insert(std::make_pair(lt_dlgetinfo(handle)->name, std::make_pair(handle, false))).first; } if(!mod->second.second) { - void (*initFun)() = (void(*)())lt_dlsym(mod->second.first, "init"); + void (*initFun)() = (void(*)())lt_dlsym(mod->second.first, (name + "_init").c_str()); if(initFun) (*initFun)(); @@ -95,7 +98,7 @@ lt_dlhandle ModuleManager::loadModule(const std::string &name) { void ModuleManager::unloadModule(const std::string &name) { void (*deinitFun)(); - deinitFun = (void(*)())lt_dlsym(modules[name].first, "deinit"); + deinitFun = (void(*)())lt_dlsym(modules[name].first, (name + "_deinit").c_str()); if(deinitFun) (*deinitFun)(); -- cgit v1.2.3