aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2004-12-28 20:29:42 +0000
committerMax Horn2004-12-28 20:29:42 +0000
commitb15d92e470fa09a76540b42d1ab1b6f24515ee74 (patch)
treee0df2f5f80e2a0fc635e054d68968cb9dd2a8708
parent49393c0f414d5f5b02cf2e7ee04e3b14b1954539 (diff)
downloadscummvm-rg350-b15d92e470fa09a76540b42d1ab1b6f24515ee74.tar.gz
scummvm-rg350-b15d92e470fa09a76540b42d1ab1b6f24515ee74.tar.bz2
scummvm-rg350-b15d92e470fa09a76540b42d1ab1b6f24515ee74.zip
Fix running ScummVM in plugin-mode
svn-id: r16360
-rw-r--r--base/plugins.cpp2
-rw-r--r--common/config-manager.cpp2
-rw-r--r--common/singleton.h8
-rw-r--r--gui/newgui.cpp2
-rw-r--r--sound/audiocd.cpp2
5 files changed, 14 insertions, 2 deletions
diff --git a/base/plugins.cpp b/base/plugins.cpp
index ddc00320c7..08093e0d76 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -196,6 +196,8 @@ void DynamicPlugin::unloadPlugin() {
#pragma mark -
+DECLARE_SINGLETON(PluginManager);
+
PluginManager::PluginManager() {
}
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index 5bf26fbe50..fc7bbdfec1 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -24,6 +24,8 @@
#include "common/config-manager.h"
+DECLARE_SINGLETON(Common::ConfigManager);
+
#if defined(UNIX)
#ifdef MACOSX
#define DEFAULT_CONFIG_FILE "Library/Preferences/ScummVM Preferences"
diff --git a/common/singleton.h b/common/singleton.h
index d259102e07..8ea666cbed 100644
--- a/common/singleton.h
+++ b/common/singleton.h
@@ -55,8 +55,12 @@ protected:
~Singleton<T>() { }
};
-template <class T>
-T* Singleton<T>::_singleton=0;
+//TODO: The following poses a problem when building ScummVM with plugins...
+
+//template <class T>
+//T* Singleton<T>::_singleton=0;
+
+#define DECLARE_SINGLETON(T) T* Common::Singleton<T>::_singleton=0
} // End of namespace Common
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index fb6b2f1784..1720e943a8 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -28,6 +28,8 @@
//#define NEW_FONT_CODE
+DECLARE_SINGLETON(GUI::NewGui);
+
namespace GUI {
diff --git a/sound/audiocd.cpp b/sound/audiocd.cpp
index 1084b98fb8..aceed46306 100644
--- a/sound/audiocd.cpp
+++ b/sound/audiocd.cpp
@@ -57,6 +57,8 @@ static const TrackFormat TRACK_FORMATS[] = {
};
+DECLARE_SINGLETON(AudioCDManager);
+
AudioCDManager::AudioCDManager() {
memset(&_cd, 0, sizeof(_cd));
memset(_cached_tracks, 0, sizeof(_cached_tracks));