aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Comstedt2004-08-22 21:41:22 +0000
committerMarcus Comstedt2004-08-22 21:41:22 +0000
commitba39d7a3dbe8cfce4293838e87c1ff6caa1a27d6 (patch)
treefc2d731ed976cec667597f18f5e91097f7ceaec8
parentc8d0270510ea09c9080759e1cbd353ba07391ac6 (diff)
downloadscummvm-rg350-ba39d7a3dbe8cfce4293838e87c1ff6caa1a27d6.tar.gz
scummvm-rg350-ba39d7a3dbe8cfce4293838e87c1ff6caa1a27d6.tar.bz2
scummvm-rg350-ba39d7a3dbe8cfce4293838e87c1ff6caa1a27d6.zip
Support dynamic plugins on Dreamcast.
svn-id: r14688
-rw-r--r--base/plugins.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/base/plugins.cpp b/base/plugins.cpp
index c096d1813a..cab71bf20a 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -39,9 +39,15 @@ typedef DetectedGameList (*DetectFunc)(const FSList &fslist);
#ifdef UNIX
#include <dlfcn.h>
+#define DYNAMIC_PLUGIN_PATH(name) (name "/lib" name ".so")
+#else
+#ifdef __DC__
+#include "dcloader.h"
+#define DYNAMIC_PLUGIN_PATH(name) (name ".plg")
#else
#error No support for loading plugins on non-unix systems at this point!
#endif
+#endif
#endif
@@ -123,7 +129,7 @@ public:
};
void *DynamicPlugin::findSymbol(const char *symbol) {
-#ifdef UNIX
+#if defined(UNIX)||defined(__DC__)
void *func = dlsym(_dlHandle, symbol);
if (!func)
warning("Failed loading symbol '%s' from plugin '%s' (%s)", symbol, _filename.c_str(), dlerror());
@@ -172,6 +178,10 @@ bool DynamicPlugin::loadPlugin() {
return false;
}
+#ifdef __DC__
+ dlforgetsyms(_dlHandle);
+#endif
+
return true;
}
@@ -211,7 +221,7 @@ void PluginManager::loadPlugins() {
// the "ABI" version the plugin was built for, and we can compare that
// to the ABI version of the executable.
#define LOAD_MODULE(name, NAME) \
- tryLoadPlugin(new DynamicPlugin(name "/lib" name ".so"));
+ tryLoadPlugin(new DynamicPlugin(DYNAMIC_PLUGIN_PATH(name)));
#else
// "Loader" for the static plugins
#define LOAD_MODULE(name, NAME) \