[Scummvm-cvs-logs] CVS: scummvm/base plugins.cpp,1.33,1.34

Marcus Comstedt marcus_c at users.sourceforge.net
Sun Aug 22 14:42:05 CEST 2004


Update of /cvsroot/scummvm/scummvm/base
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10593/base

Modified Files:
	plugins.cpp 
Log Message:
Support dynamic plugins on Dreamcast.

Index: plugins.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/base/plugins.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- plugins.cpp	9 May 2004 13:12:18 -0000	1.33
+++ plugins.cpp	22 Aug 2004 21:41:22 -0000	1.34
@@ -39,9 +39,15 @@
 
 #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 @@
 };
 
 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 @@
 		return false;
 	}
 
+#ifdef __DC__
+	dlforgetsyms(_dlHandle);
+#endif
+
 	return true;
 }
 
@@ -211,7 +221,7 @@
 	// 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) \





More information about the Scummvm-git-logs mailing list