view generator/global.h @ 393:1049b01aebd2

Fixed generator segfaults on OS X 10.6. Regarding the change to dgenerator.cpp, I am not actually sure if 0 is the correct value to pass, but it seems to work and the code which had been there before was just plain incorrect ? it read past the list boundaries.
author David Nadlinger <code@klickverbot.at>
date Sat, 28 Aug 2010 02:55:55 +0200
parents e700fa4916e4
children
line wrap: on
line source

#ifndef GLOBAL_H
#define GLOBAL_H

#include <QString>

class Global
{
public:
    enum TargetPlatform
    {
        UnixTarget,
        Win32Target
    };

    TargetPlatform targetPlatform;
    bool cppShared;
    bool dPhobos;
    int dVersion;


    void setTargetPlatform(QString tp)
    {
        if (tp == "win32")
            targetPlatform = Win32Target;
        else if (tp == "unix")
            targetPlatform = UnixTarget;

        else if (tp.isEmpty()) {
#if WIN32
            targetPlatform = Win32Target;
#else
            targetPlatform = UnixTarget;
#endif
        }
        else
            qFatal("Target platform %s is not supported", qPrintable(tp));
    }

    Global();

};

extern Global global;

#endif // GLOBAL_H