[Scummvm-cvs-logs] SF.net SVN: scummvm: [21806] scummvm/trunk/common/file.cpp
chrilith at users.sourceforge.net
chrilith at users.sourceforge.net
Tue Apr 11 11:26:01 CEST 2006
Revision: 21806
Author: chrilith
Date: 2006-04-11 11:25:04 -0700 (Tue, 11 Apr 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21806&view=rev
Log Message:
-----------
Bad hack to make the file class work agaain with PalmOS ARM version - read the comment for more details
Modified Paths:
--------------
scummvm/trunk/common/file.cpp
Modified: scummvm/trunk/common/file.cpp
===================================================================
--- scummvm/trunk/common/file.cpp 2006-04-11 18:19:54 UTC (rev 21805)
+++ scummvm/trunk/common/file.cpp 2006-04-11 18:25:04 UTC (rev 21806)
@@ -37,9 +37,20 @@
// The following two objects could be turned into static members of class
// File. However, then we would be forced to #include hashmap in file.h
// which seems to be a high price just for a simple beautification...
+#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG))
static StringIntMap _defaultDirectories;
static FilesMap _filesMap;
+#else
+// This is a very bad hack to make these global objects work with PalmOS ARM version.
+// In fact global objects are correctly allocated but constructors/destructors are not called
+// and so, the object is not correctly initialized. See also the 2 functions at end of file.
+// This is related to how ARM apps are handled in PalmOS, there is no problem with 68k version.
+static StringIntMap *__defaultDirectories;
+static FilesMap *__filesMap;
+#define _defaultDirectories (*__defaultDirectories)
+#define _filesMap (*__filesMap)
+#endif
static FILE *fopenNoCase(const char *filename, const char *directory, const char *mode) {
FILE *file;
@@ -359,3 +370,14 @@
}
} // End of namespace Common
+
+#if defined(PALMOS_ARM) || defined(PALMOS_DEBUG)
+void initGlobalHashes() {
+ Common::__defaultDirectories = new Common::StringIntMap;
+ Common::__filesMap = new Common::FilesMap;
+}
+void freeGlobalHashes() {
+ delete Common::__defaultDirectories;
+ delete Common::__filesMap;
+}
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list