diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h index cbc2b12959a..68212e05fbb 100644 --- a/src/shared/proparser/qmakeevaluator.h +++ b/src/shared/proparser/qmakeevaluator.h @@ -39,6 +39,7 @@ #include "ioutils.h" #include +#include #include #include #include @@ -71,7 +72,16 @@ public: virtual void doneWithEval(ProFile *parent) = 0; }; -typedef QStack 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 +{ +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 {