diff options
Diffstat (limited to 'backends/plugins')
-rw-r--r-- | backends/plugins/dc/dc-provider.cpp | 3 | ||||
-rw-r--r-- | backends/plugins/dynamic-plugin.h | 9 | ||||
-rw-r--r-- | backends/plugins/elf/elf-provider.h | 3 | ||||
-rw-r--r-- | backends/plugins/posix/posix-provider.cpp | 3 | ||||
-rw-r--r-- | backends/plugins/sdl/sdl-provider.cpp | 3 | ||||
-rw-r--r-- | backends/plugins/win32/win32-provider.cpp | 3 |
6 files changed, 14 insertions, 10 deletions
diff --git a/backends/plugins/dc/dc-provider.cpp b/backends/plugins/dc/dc-provider.cpp index 67877dc9f4..86ef68828c 100644 --- a/backends/plugins/dc/dc-provider.cpp +++ b/backends/plugins/dc/dc-provider.cpp @@ -37,7 +37,6 @@ class DCPlugin : public DynamicPlugin { protected: void *_dlHandle; - Common::String _filename; virtual VoidFunc findSymbol(const char *symbol) { void *func = dlsym(_dlHandle, symbol); @@ -56,7 +55,7 @@ protected: public: DCPlugin(const Common::String &filename) - : _dlHandle(0), _filename(filename) {} + : DynamicPlugin(filename), _dlHandle(0) {} bool loadPlugin() { assert(!_dlHandle); diff --git a/backends/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h index ec051c4ed7..32d411656c 100644 --- a/backends/plugins/dynamic-plugin.h +++ b/backends/plugins/dynamic-plugin.h @@ -37,7 +37,12 @@ protected: virtual VoidFunc findSymbol(const char *symbol) = 0; + const Common::String _filename; + public: + DynamicPlugin(const Common::String &filename) : + _filename(filename) {} + virtual bool loadPlugin() { // Validate the plugin API version IntFunc verFunc = (IntFunc)findSymbol("PLUGIN_getVersion"); @@ -97,6 +102,10 @@ public: virtual void unloadPlugin() { delete _pluginObject; } + + virtual const char *getFileName() const { + return _filename.c_str(); + } }; #endif diff --git a/backends/plugins/elf/elf-provider.h b/backends/plugins/elf/elf-provider.h index fe8346f95e..8cc9e0a996 100644 --- a/backends/plugins/elf/elf-provider.h +++ b/backends/plugins/elf/elf-provider.h @@ -48,15 +48,14 @@ protected: typedef const char *(*CharFunc)(); DLObject *_dlHandle; - Common::String _filename; void *_dso_handle; virtual VoidFunc findSymbol(const char *symbol); public: ELFPlugin(const Common::String &filename) : + DynamicPlugin(filename), _dlHandle(0), - _filename(filename), _dso_handle(0) { } diff --git a/backends/plugins/posix/posix-provider.cpp b/backends/plugins/posix/posix-provider.cpp index 01e48739bd..dd3591a992 100644 --- a/backends/plugins/posix/posix-provider.cpp +++ b/backends/plugins/posix/posix-provider.cpp @@ -37,7 +37,6 @@ class POSIXPlugin : public DynamicPlugin { protected: void *_dlHandle; - Common::String _filename; virtual VoidFunc findSymbol(const char *symbol) { void *func = dlsym(_dlHandle, symbol); @@ -56,7 +55,7 @@ protected: public: POSIXPlugin(const Common::String &filename) - : _dlHandle(0), _filename(filename) {} + : DynamicPlugin(filename), _dlHandle(0) {} bool loadPlugin() { assert(!_dlHandle); diff --git a/backends/plugins/sdl/sdl-provider.cpp b/backends/plugins/sdl/sdl-provider.cpp index 51c19fcef3..5172abc4b0 100644 --- a/backends/plugins/sdl/sdl-provider.cpp +++ b/backends/plugins/sdl/sdl-provider.cpp @@ -36,7 +36,6 @@ class SDLPlugin : public DynamicPlugin { protected: void *_dlHandle; - Common::String _filename; virtual VoidFunc findSymbol(const char *symbol) { void *func = SDL_LoadFunction(_dlHandle, symbol); @@ -55,7 +54,7 @@ protected: public: SDLPlugin(const Common::String &filename) - : _dlHandle(0), _filename(filename) {} + : DynamicPlugin(filename), _dlHandle(0) {} bool loadPlugin() { assert(!_dlHandle); diff --git a/backends/plugins/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp index 16532d4059..793b1bfc0c 100644 --- a/backends/plugins/win32/win32-provider.cpp +++ b/backends/plugins/win32/win32-provider.cpp @@ -51,7 +51,6 @@ private: protected: void *_dlHandle; - Common::String _filename; virtual VoidFunc findSymbol(const char *symbol) { #ifndef _WIN32_WCE @@ -67,7 +66,7 @@ protected: public: Win32Plugin(const Common::String &filename) - : _dlHandle(0), _filename(filename) {} + : DynamicPlugin(filename), _dlHandle(0) {} bool loadPlugin() { assert(!_dlHandle); |