Ticket #8391: makeinstance.patch

File makeinstance.patch, 1.7 KB (added by fingolfin, 19 years ago)

Yet another patch, maybe helps GCC 3.2.x?

  • common/system.h

    RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
    retrieving revision 1.80
    diff -u -d -r1.80 system.h
     
    2929#include "common/savefile.h"
    3030#include "common/singleton.h"
    3131
    32 class OSystem;
    33 
    34 /**
    35  * Custom object factory for OSystem.
    36  */
    37 template <>
    38 OSystem *Common::Singleton<OSystem>::makeInstance();
    39 
    4032
    4133/**
    4234 * Interface for ScummVM backends. If you want to port ScummVM to a system
     
    4941 * control audio CD playback, and sound output.
    5042 */
    5143class OSystem : public Common::Singleton<OSystem> {
     44protected:
     45        static OSystem *createSystem();
     46        friend class Common::Singleton<SingletonBaseType>;
     47
    5248public:
    5349       
    5450        /** @name Feature flags */
     
    682678        //@}
    683679};
    684680
     681/**
     682 * Custom object factory for OSystem.
     683 */
     684template <>
     685OSystem *Common::Singleton<OSystem>::makeInstance() {
     686        return OSystem::createSystem();
     687}
     688
     689
     690
    685691/** The global OSystem instance. Inited in main(). */
    686692#define g_system        (&OSystem::instance())
    687693
  • common/system.cpp

    RCS file: /cvsroot/scummvm/scummvm/common/system.cpp,v
    retrieving revision 1.17
    diff -u -d -r1.17 system.cpp
     
    3333
    3434DECLARE_SINGLETON(OSystem);
    3535
    36 template <>
    37 OSystem *Common::Singleton<OSystem>::makeInstance() {
     36OSystem *OSystem::createSystem() {
    3837        // Attention: Do not call parseGraphicsMode() here, nor any other function
    3938        // which needs to access the OSystem instance, else you get stuck in an
    4039        // endless loop.