summaryrefslogtreecommitdiffstats
path: root/src/Common/ModuleManager.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-05-20 20:04:09 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-05-20 20:04:09 +0200
commit325ee09f8fa61185efd6ec8b64b6432686170ac8 (patch)
tree7380bd046d2582034b44905b2dfe71c77f27c0e4 /src/Common/ModuleManager.cpp
parent4bbe42a77b6782fd6889e673c10316f7e668eae8 (diff)
downloadmad-325ee09f8fa61185efd6ec8b64b6432686170ac8.tar
mad-325ee09f8fa61185efd6ec8b64b6432686170ac8.zip
Module wieder heil-gebastelt
Diffstat (limited to 'src/Common/ModuleManager.cpp')
-rw-r--r--src/Common/ModuleManager.cpp9
1 files changed, 6 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>.
*/
+
+#include <config.h>
+
#include "ModuleManager.h"
#include "ConfigEntry.h"
@@ -73,7 +76,7 @@ lt_dlhandle ModuleManager::loadModule(const std::string &name) {
std::map<std::string, std::pair<lt_dlhandle, bool> >::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)();