make the value map stack QLinkedList-based

this ensures that the addresses of the maps stay constant, which the
qmake generators assume.

Change-Id: Ic9f20c75527e0d741a2d4f89d2c587e12724d2ed
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-08-27 11:53:32 +02:00
parent 3c740066b7
commit 217db813fc

View File

@@ -39,6 +39,7 @@
#include "ioutils.h" #include "ioutils.h"
#include <QList> #include <QList>
#include <QLinkedList>
#include <QSet> #include <QSet>
#include <QStack> #include <QStack>
#include <QString> #include <QString>
@@ -71,7 +72,16 @@ public:
virtual void doneWithEval(ProFile *parent) = 0; virtual void doneWithEval(ProFile *parent) = 0;
}; };
typedef QStack<ProValueMap> ProValueMapStack; // We use a QLinkedList based stack instead of a QVector based one (QStack), so that
// the addresses of value maps stay constant. The qmake generators rely on that.
class QMAKE_EXPORT ProValueMapStack : public QLinkedList<ProValueMap>
{
public:
inline void push(const ProValueMap &t) { append(t); }
inline ProValueMap pop() { return takeLast(); }
ProValueMap &top() { return last(); }
const ProValueMap &top() const { return last(); }
};
class QMAKE_EXPORT QMakeEvaluator class QMAKE_EXPORT QMakeEvaluator
{ {