diff options
author | Chris Apers | 2005-10-08 19:07:18 +0000 |
---|---|---|
committer | Chris Apers | 2005-10-08 19:07:18 +0000 |
commit | 12f40ae7776ff6204212c91e819951d5ff4eec66 (patch) | |
tree | 1a0eaab15624501aeff3ed686691b5e2a309cd47 /common | |
parent | 528d2b2ca184ab92a42f96f4527cf2298bca4b09 (diff) | |
download | scummvm-rg350-12f40ae7776ff6204212c91e819951d5ff4eec66.tar.gz scummvm-rg350-12f40ae7776ff6204212c91e819951d5ff4eec66.tar.bz2 scummvm-rg350-12f40ae7776ff6204212c91e819951d5ff4eec66.zip |
PalmOS: cannot use global objects in ARM
svn-id: r18962
Diffstat (limited to 'common')
-rw-r--r-- | common/str.cpp | 7 | ||||
-rw-r--r-- | common/str.h | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/common/str.cpp b/common/str.cpp index 481d3e3ddc..699f1c096b 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -25,11 +25,17 @@ namespace Common { +#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG)) const String String::emptyString; +#else +const char *String::emptyString = ""; +#endif String::String(const char *str, int len) : _str(0), _len(0) { + _refCount = new int(1); + if (str && len != 0) { if (len > 0) _capacity = _len = len; @@ -46,6 +52,7 @@ String::String(const char *str, int len) String::String(const String &str) : _str(0), _len(0) { + ++(*str._refCount); _refCount = str._refCount; diff --git a/common/str.h b/common/str.h index 2c68630507..f8052c74ae 100644 --- a/common/str.h +++ b/common/str.h @@ -37,7 +37,11 @@ protected: int _capacity; public: +#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG)) static const String emptyString; +#else + static const char *emptyString; +#endif String() : _str(0), _len(0), _capacity(0) { _refCount = new int(1); } String(const char *str, int len = -1); |