diff options
author | Matthew Hoops | 2011-05-11 00:30:02 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-05-11 00:30:28 -0400 |
commit | a1d41da096c0bcf502a85919cb1cb1ee471719c5 (patch) | |
tree | 8c51419daa486f1d4833757db4715dadab6c3497 /backends/plugins | |
parent | accb0c2a5d0c9e7b353cda4b74f511a498ed8073 (diff) | |
parent | 33c3e19cea2a08fbf26ecbe940763e8ee1c37d28 (diff) | |
download | scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.gz scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.bz2 scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.zip |
Merge remote branch 'upstream/master' into t7g-ios
Conflicts:
audio/decoders/qdm2.h
common/util.cpp
engines/groovie/music.cpp
engines/groovie/resource.h
video/qt_decoder.cpp
video/qt_decoder.h
Diffstat (limited to 'backends/plugins')
-rw-r--r-- | backends/plugins/dc/dc-provider.cpp | 101 | ||||
-rw-r--r-- | backends/plugins/dc/dc-provider.h | 42 | ||||
-rw-r--r-- | backends/plugins/dynamic-plugin.h | 1 | ||||
-rw-r--r-- | backends/plugins/elf/memory-manager.cpp | 1 | ||||
-rw-r--r-- | backends/plugins/sdl/sdl-provider.h | 2 |
5 files changed, 3 insertions, 144 deletions
diff --git a/backends/plugins/dc/dc-provider.cpp b/backends/plugins/dc/dc-provider.cpp deleted file mode 100644 index 86ef68828c..0000000000 --- a/backends/plugins/dc/dc-provider.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/scummsys.h" - -#if defined(DYNAMIC_MODULES) && defined(__DC__) - -#include "backends/plugins/dc/dc-provider.h" -#include "backends/plugins/dynamic-plugin.h" -#include "common/fs.h" - -#include "dcloader.h" - - -class DCPlugin : public DynamicPlugin { -protected: - void *_dlHandle; - - virtual VoidFunc findSymbol(const char *symbol) { - void *func = dlsym(_dlHandle, symbol); - if (!func) - warning("Failed loading symbol '%s' from plugin '%s' (%s)", symbol, _filename.c_str(), dlerror()); - - // FIXME HACK: This is a HACK to circumvent a clash between the ISO C++ - // standard and POSIX: ISO C++ disallows casting between function pointers - // and data pointers, but dlsym always returns a void pointer. For details, - // see e.g. <http://www.trilithium.com/johan/2004/12/problem-with-dlsym/>. - assert(sizeof(VoidFunc) == sizeof(func)); - VoidFunc tmp; - memcpy(&tmp, &func, sizeof(VoidFunc)); - return tmp; - } - -public: - DCPlugin(const Common::String &filename) - : DynamicPlugin(filename), _dlHandle(0) {} - - bool loadPlugin() { - assert(!_dlHandle); - _dlHandle = dlopen(_filename.c_str(), RTLD_LAZY); - - if (!_dlHandle) { - warning("Failed loading plugin '%s' (%s)", _filename.c_str(), dlerror()); - return false; - } - - bool ret = DynamicPlugin::loadPlugin(); - - if (ret) - dlforgetsyms(_dlHandle); - - return ret; - } - - void unloadPlugin() { - DynamicPlugin::unloadPlugin(); - if (_dlHandle) { - if (dlclose(_dlHandle) != 0) - warning("Failed unloading plugin '%s' (%s)", _filename.c_str(), dlerror()); - _dlHandle = 0; - } - } -}; - - -Plugin* DCPluginProvider::createPlugin(const Common::FSNode &node) const { - return new DCPlugin(node.getPath()); -} - -bool DCPluginProvider::isPluginFilename(const Common::FSNode &node) const { - // Check the plugin suffix - Common::String filename = node.getName(); - if (!filename.hasSuffix(".PLG")) - return false; - - return true; -} - -#endif // defined(DYNAMIC_MODULES) && defined(__DC__) diff --git a/backends/plugins/dc/dc-provider.h b/backends/plugins/dc/dc-provider.h deleted file mode 100644 index 55413ade5a..0000000000 --- a/backends/plugins/dc/dc-provider.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#ifndef BACKENDS_PLUGINS_DC_H -#define BACKENDS_PLUGINS_DC_H - -#include "base/plugins.h" - -#if defined(DYNAMIC_MODULES) && defined(__DC__) - -class DCPluginProvider : public FilePluginProvider { -protected: - Plugin* createPlugin(const Common::FSNode &node) const; - - bool isPluginFilename(const Common::FSNode &node) const; -}; - -#endif // defined(DYNAMIC_MODULES) && defined(__DC__) - -#endif diff --git a/backends/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h index 32d411656c..775e887105 100644 --- a/backends/plugins/dynamic-plugin.h +++ b/backends/plugins/dynamic-plugin.h @@ -27,6 +27,7 @@ #define BACKENDS_PLUGINS_DYNAMICPLUGIN_H #include "base/plugins.h" +#include "common/textconsole.h" class DynamicPlugin : public Plugin { diff --git a/backends/plugins/elf/memory-manager.cpp b/backends/plugins/elf/memory-manager.cpp index b2ac497771..d32ac2da28 100644 --- a/backends/plugins/elf/memory-manager.cpp +++ b/backends/plugins/elf/memory-manager.cpp @@ -28,6 +28,7 @@ #if defined(DYNAMIC_MODULES) && defined(USE_ELF_LOADER) #include "backends/plugins/elf/memory-manager.h" +#include "common/debug.h" #include "common/util.h" #include <malloc.h> diff --git a/backends/plugins/sdl/sdl-provider.h b/backends/plugins/sdl/sdl-provider.h index b546b028a2..350261a37f 100644 --- a/backends/plugins/sdl/sdl-provider.h +++ b/backends/plugins/sdl/sdl-provider.h @@ -35,6 +35,6 @@ protected: Plugin* createPlugin(const Common::FSNode &node) const; }; -#endif // defined(DYNAMIC_MODULES) && defined(UNIX) +#endif // defined(DYNAMIC_MODULES) && defined(SDL_BACKEND) #endif |