[Scummvm-cvs-logs] CVS: scummvm/common system.h,1.81,1.82 system.cpp,1.18,1.19 singleton.h,1.10,1.11
Max Horn
fingolfin at users.sourceforge.net
Mon Jan 10 13:07:08 CET 2005
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22933
Modified Files:
system.h system.cpp singleton.h
Log Message:
yet another attempt to get makeInstance working for gcc 3.3, gcc 3.2, and MSVC (thanks to wjp for the suggestion). Works fine with GCC 3.2 and 3.3
Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- system.h 9 Jan 2005 01:41:43 -0000 1.81
+++ system.h 10 Jan 2005 21:06:49 -0000 1.82
@@ -42,7 +42,7 @@
*/
class OSystem : public Common::Singleton<OSystem> {
protected:
- static OSystem *createSystem();
+ static OSystem *makeInstance();
friend class Common::Singleton<SingletonBaseType>;
public:
@@ -678,12 +678,6 @@
//@}
};
-/**
- * Custom object factory for OSystem.
- */
-template <>
-OSystem *Common::Singleton<OSystem>::makeInstance();
-
/** The global OSystem instance. Inited in main(). */
Index: system.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- system.cpp 9 Jan 2005 01:41:43 -0000 1.18
+++ system.cpp 10 Jan 2005 21:06:49 -0000 1.19
@@ -33,12 +33,7 @@
DECLARE_SINGLETON(OSystem);
-template <>
-OSystem *Common::Singleton<OSystem>::makeInstance() {
- return OSystem::createSystem();
-}
-
-OSystem *OSystem::createSystem() {
+OSystem *OSystem::makeInstance() {
// Attention: Do not call parseGraphicsMode() here, nor any other function
// which needs to access the OSystem instance, else you get stuck in an
// endless loop.
Index: singleton.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/singleton.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- singleton.h 6 Jan 2005 18:38:33 -0000 1.10
+++ singleton.h 10 Jan 2005 21:06:49 -0000 1.11
@@ -60,7 +60,7 @@
// order might become an issue. There are various approaches
// to solve that problem, but for now this is sufficient
if (!_singleton)
- _singleton = makeInstance();
+ _singleton = T::makeInstance();
return *_singleton;
}
protected:
More information about the Scummvm-git-logs
mailing list