aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorLars Persson2005-06-21 22:08:21 +0000
committerLars Persson2005-06-21 22:08:21 +0000
commit1c69696a9a8878971c4fa925b074498dab757857 (patch)
treed8f4f2cfea1a3e01bb7f5f5c58fb812d8029ca96 /common
parent4564f0d3bf0d40f5a2ca125df0682969adc8431c (diff)
downloadscummvm-rg350-1c69696a9a8878971c4fa925b074498dab757857.tar.gz
scummvm-rg350-1c69696a9a8878971c4fa925b074498dab757857.tar.bz2
scummvm-rg350-1c69696a9a8878971c4fa925b074498dab757857.zip
Patches needed to build for SYMBIAN32 WINS/GCC added.
Test built for Symbian and run on P910i without any major problems. Test built for MSVC6. Changed parts seems to compile ok but there are some problems with MSVC6 and some of the targets which the EPOC build does n't support (KYRA,SAGA). svn-id: r18430
Diffstat (limited to 'common')
-rw-r--r--common/array.h7
-rw-r--r--common/config-file.cpp2
-rw-r--r--common/config-manager.cpp4
-rw-r--r--common/debugger.cpp2
-rw-r--r--common/debugger.h5
-rw-r--r--common/list.h7
-rw-r--r--common/map.h7
-rw-r--r--common/scummsys.h28
-rw-r--r--common/singleton.h8
-rw-r--r--common/system.cpp2
-rw-r--r--common/util.cpp7
11 files changed, 71 insertions, 8 deletions
diff --git a/common/array.h b/common/array.h
index 8116e94c9a..63b7fca533 100644
--- a/common/array.h
+++ b/common/array.h
@@ -47,7 +47,12 @@ public:
_data[i] = array._data[i];
}
- ~Array<T>() {
+#ifdef __SYMBIAN32__
+ ~Array()
+#else
+ ~Array<T>()
+#endif
+ {
if (_data)
delete [] _data;
}
diff --git a/common/config-file.cpp b/common/config-file.cpp
index bec91a789e..5ce5ca4d8d 100644
--- a/common/config-file.cpp
+++ b/common/config-file.cpp
@@ -250,7 +250,7 @@ void ConfigFile::removeKey(const String &key, const String &section) {
Section *s = getSection(section);
if (s)
- return s->removeKey(key);
+ s->removeKey(key);
}
bool ConfigFile::getKey(const String &key, const String &section, String &value) const {
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index 8cd2ed3222..0d11ec6dd3 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -86,13 +86,15 @@ void ConfigManager::loadDefaultConfigFile() {
else
strcpy(configFile, DEFAULT_CONFIG_FILE);
#else
- #if defined (WIN32) && !defined(_WIN32_WCE)
+ #if defined (WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
GetWindowsDirectory(configFile, MAXPATHLEN);
strcat(configFile, "\\" DEFAULT_CONFIG_FILE);
#elif defined(__PALM_OS__)
strcpy(configFile,"/PALM/Programs/ScummVM/" DEFAULT_CONFIG_FILE);
#elif defined(__PLAYSTATION2__)
strcpy(configFile, "mc0:ScummVM/" DEFAULT_CONFIG_FILE);
+ #elif defined (__SYMBIAN32__)
+ strcpy(configFile, SYMBIAN32_DOC_DIR DEFAULT_CONFIG_FILE);
#else
strcpy(configFile, DEFAULT_CONFIG_FILE);
#endif
diff --git a/common/debugger.cpp b/common/debugger.cpp
index 8d967a1792..360ce8489f 100644
--- a/common/debugger.cpp
+++ b/common/debugger.cpp
@@ -65,6 +65,7 @@ int Debugger<T>::DebugPrintf(const char *format, ...) {
return count;
}
+#ifndef __SYMBIAN32__ // gcc/UIQ doesn't like the debugger code for some reason? Actually get a cc1plus core dump here :)
template <class T>
void Debugger<T>::attach(const char *entry) {
@@ -105,6 +106,7 @@ void Debugger<T>::onFrame() {
detach();
}
}
+#endif // of ifndef __SYMBIAN32__ // gcc/UIQ doesn't like the debugger code for some reason? Actually get a cc1plus core dump here :)
// Main Debugger Loop
template <class T>
diff --git a/common/debugger.h b/common/debugger.h
index d93b6175a5..bf028a9cb5 100644
--- a/common/debugger.h
+++ b/common/debugger.h
@@ -38,9 +38,14 @@ public:
int DebugPrintf(const char *format, ...);
+#ifndef __SYMBIAN32__ // gcc/UIQ doesn't like the debugger code for some reason? Actually get a cc1plus core dump here :)
virtual void onFrame();
virtual void attach(const char *entry = 0);
+#else
+ void onFrame() {}
+ void attach(const char *entry = 0) {}
+#endif
bool isAttached() const { return _isAttached; }
protected:
diff --git a/common/list.h b/common/list.h
index 7de13c2f91..03d6076635 100644
--- a/common/list.h
+++ b/common/list.h
@@ -121,7 +121,12 @@ public:
insert(begin(), list.begin(), list.end());
}
- ~List<T>() {
+#ifndef __SYMBIAN32__
+ ~List<T>()
+#else
+ ~List()
+#endif
+ {
clear();
delete _anchor;
}
diff --git a/common/map.h b/common/map.h
index ad264580a5..0dac581bd2 100644
--- a/common/map.h
+++ b/common/map.h
@@ -110,7 +110,12 @@ public:
_header->_right = _header->_left = _header;
}
- virtual ~Map<Key, Value, Comparator>() {
+#ifndef __SYMBIAN32__
+ virtual ~Map<Key, Value, Comparator>()
+#else
+ ~Map()
+#endif
+ {
clearNodes(_root);
delete _header;
_root = _header = 0;
diff --git a/common/scummsys.h b/common/scummsys.h
index a0ba3622c1..b1d7c13166 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -38,6 +38,11 @@
#define PI 3.14159265358979323846
#endif
+// make sure we really are compiling for WIN32
+#ifndef WIN32
+#undef _MSC_VER
+#endif
+
#if defined(_MSC_VER)
#define scumm_stricmp stricmp
@@ -289,6 +294,29 @@
typedef unsigned char byte;
typedef unsigned int uint;
#endif
+#elif defined __SYMBIAN32__ // AnotherGuest / Sprawl / SumthinWicked
+
+ #define scumm_stricmp strcasecmp
+ #define scumm_strnicmp strncasecmp
+
+ #define CDECL
+ #define SCUMM_NEED_ALIGNMENT
+ #define SCUMM_LITTLE_ENDIAN
+ #define CHECK_HEAP
+
+ #define FORCEINLINE inline
+ #define _HEAPOK 0
+ typedef unsigned char byte;
+ typedef unsigned char uint8;
+ typedef unsigned short int uint16;
+ typedef unsigned long int uint32;
+ typedef unsigned int uint;
+ typedef signed char int8;
+ typedef signed short int int16;
+ typedef signed long int int32;
+
+ #define START_PACK_STRUCTS pack (push,1)
+ #define END_PACK_STRUCTS pack(pop)
#else
#error No system type defined
#endif
diff --git a/common/singleton.h b/common/singleton.h
index 5be31e2c24..dec2844124 100644
--- a/common/singleton.h
+++ b/common/singleton.h
@@ -45,7 +45,7 @@ private:
* and you specialise makeInstance to return an instance of a subclass.
*/
//template <class T>
-#if defined (_WIN32_WCE) || defined (_MSC_VER)
+#if defined (_WIN32_WCE) || defined (_MSC_VER) || defined (__WINS__)
//FIXME evc4 and msvc7 doesn't like it as private member
public:
#endif
@@ -69,7 +69,11 @@ public:
}
protected:
Singleton<T>() { }
- virtual ~Singleton<T>() { }
+#ifdef __SYMBIAN32__
+ virtual ~Singleton() { }
+#else
+ virtual ~Singleton<T>() { }
+#endif
typedef T SingletonBaseType;
};
diff --git a/common/system.cpp b/common/system.cpp
index 16b707e79e..1a717f292b 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -56,6 +56,8 @@ OSystem *OSystem::makeInstance() {
return OSystem_PALMOS_create();
#elif defined(__PLAYSTATION2__)
return OSystem_PS2_create();
+#elif defined(__SYMBIAN32__) // SumthinWicked / Sprawl
+ return OSystem_SymbianOS_create();
#else
/* SDL is the default driver for now */
return OSystem_SDL_create();
diff --git a/common/util.cpp b/common/util.cpp
index b1b657462e..831284d428 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -82,7 +82,12 @@ void hexdump(const byte * data, int len, int bytesPerLine) {
RandomSource::RandomSource() {
// Use system time as RNG seed. Normally not a good idea, if you are using
// a RNG for security purposes, but good enough for our purposes.
- setSeed(time(0));
+#if defined (__SYMBIAN32__) && defined (__WINS__)
+ uint32 seed = 0; // Symbian produces RT crash on time(0)
+#else
+ uint32 seed = time(0);
+#endif
+ setSeed(seed);
}
void RandomSource::setSeed(uint32 seed) {