aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/plugins/dynamic-plugin.h62
-rw-r--r--base/plugins.cpp2
-rw-r--r--base/plugins.h8
-rw-r--r--engines/metaengine.h2
4 files changed, 36 insertions, 38 deletions
diff --git a/backends/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h
index 3825f28c87..4771f1c086 100644
--- a/backends/plugins/dynamic-plugin.h
+++ b/backends/plugins/dynamic-plugin.h
@@ -39,39 +39,39 @@ protected:
public:
virtual bool loadPlugin() {
- // Validate the plugin API version
- IntFunc verFunc = (IntFunc)findSymbol("PLUGIN_getVersion");
- if (!verFunc) {
- unloadPlugin();
- return false;
- }
- if (verFunc() != PLUGIN_VERSION) {
- unloadPlugin();
- return false;
- }
+ // Validate the plugin API version
+ IntFunc verFunc = (IntFunc)findSymbol("PLUGIN_getVersion");
+ if (!verFunc) {
+ unloadPlugin();
+ return false;
+ }
+ if (verFunc() != PLUGIN_VERSION) {
+ unloadPlugin();
+ return false;
+ }
- // Get the type of the plugin
- IntFunc typeFunc = (IntFunc)findSymbol("PLUGIN_getType");
- if (!typeFunc) {
- unloadPlugin();
- return false;
- }
- _type = (PluginType)typeFunc();
- if (_type >= PLUGIN_TYPE_MAX) {
- unloadPlugin();
- return false;
- }
+ // Get the type of the plugin
+ IntFunc typeFunc = (IntFunc)findSymbol("PLUGIN_getType");
+ if (!typeFunc) {
+ unloadPlugin();
+ return false;
+ }
+ _type = (PluginType)typeFunc();
+ if (_type >= PLUGIN_TYPE_MAX) {
+ unloadPlugin();
+ return false;
+ }
- // Validate the plugin type API version
- IntFunc typeVerFunc = (IntFunc)findSymbol("PLUGIN_getTypeVersion");
- if (!typeVerFunc) {
- unloadPlugin();
- return false;
- }
- if (typeVerFunc() != pluginTypeVersions[_type]) {
- unloadPlugin();
- return false;
- }
+ // Validate the plugin type API version
+ IntFunc typeVerFunc = (IntFunc)findSymbol("PLUGIN_getTypeVersion");
+ if (!typeVerFunc) {
+ unloadPlugin();
+ return false;
+ }
+ if (typeVerFunc() != pluginTypeVersions[_type]) {
+ unloadPlugin();
+ return false;
+ }
// Get the plugin's instantiator object
GetObjectFunc getObject = (GetObjectFunc)findSymbol("PLUGIN_getObject");
diff --git a/base/plugins.cpp b/base/plugins.cpp
index e7b1faff94..90b377ff45 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -93,7 +93,7 @@ public:
PluginList pl;
#define LINK_PLUGIN(ID) \
- extern PluginType g_##ID##_type; \
+ extern PluginType g_##ID##_type; \
extern PluginObject *g_##ID##_getObject(); \
pl.push_back(new StaticPlugin(g_##ID##_getObject(), g_##ID##_type));
diff --git a/base/plugins.h b/base/plugins.h
index 6da8af0ab0..da48a7c22a 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -111,7 +111,7 @@ public:
#ifndef DYNAMIC_MODULES
#define REGISTER_PLUGIN(ID,TYPE,PLUGINCLASS) \
- PluginType g_##ID##_type = TYPE; \
+ PluginType g_##ID##_type = TYPE; \
PluginObject *g_##ID##_getObject() { \
return new PLUGINCLASS(); \
} \
@@ -119,9 +119,9 @@ public:
#else
#define REGISTER_PLUGIN(ID,TYPE,PLUGINCLASS) \
extern "C" { \
- PLUGIN_EXPORT int32 PLUGIN_getVersion() { return PLUGIN_VERSION; } \
- PLUGIN_EXPORT int32 PLUGIN_getType() { return TYPE; } \
- PLUGIN_EXPORT int32 PLUGIN_getTypeVersion() { return TYPE##_VERSION; } \
+ PLUGIN_EXPORT int32 PLUGIN_getVersion() { return PLUGIN_VERSION; } \
+ PLUGIN_EXPORT int32 PLUGIN_getType() { return TYPE; } \
+ PLUGIN_EXPORT int32 PLUGIN_getTypeVersion() { return TYPE##_VERSION; } \
PLUGIN_EXPORT PluginObject *PLUGIN_getObject() { \
return new PLUGINCLASS(); \
} \
diff --git a/engines/metaengine.h b/engines/metaengine.h
index c07a4f6e88..5db791a1b7 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -51,8 +51,6 @@ public:
/** Returns some copyright information about the engine. */
virtual const char *getCopyright() const = 0;
-// virtual int getVersion() const = 0; // TODO!
-
/** Returns a list of games supported by this engine. */
virtual GameList getSupportedGames() const = 0;