diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-02-22 13:11:09 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-02-22 18:00:26 +0100 |
commit | 72c3ba791ed898ceb1d706f467dbacd19c4ab95c (patch) | |
tree | 525b4c12ee9ed23046dfe2b94d6c0d660cd9e631 /src/libs/cplusplus/pp-engine.cpp | |
parent | 41e2b885b87e191a9a768087c5a6fc941b39660e (diff) | |
download | qt-creator-72c3ba791ed898ceb1d706f467dbacd19c4ab95c.tar.gz |
Fixed pre-processor handling for Q_PROPERTY, Q_ENUMS and Q_FLAGS.
Diffstat (limited to 'src/libs/cplusplus/pp-engine.cpp')
-rw-r--r-- | src/libs/cplusplus/pp-engine.cpp | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 3f3c7099a1..6a6e527427 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -766,34 +766,27 @@ void Preprocessor::preprocess(const QString &fileName, const QByteArray &source, expandBuiltinMacro(identifierToken, spell); else { - if (spell != "Q_PROPERTY" - && spell != "Q_INVOKABLE" - && spell != "Q_ENUMS" - && spell != "Q_FLAGS") { - - // ### FIXME: shouldn't this be T_Q_PROPERTY & friends? - - if (Macro *m = env->resolve(spell)) { - if (! m->isFunctionLike()) { - if (0 == (m = processObjectLikeMacro(identifierToken, spell, m))) - continue; + if (Macro *m = env->resolve(spell)) { + if (! m->isFunctionLike()) { + if (0 == (m = processObjectLikeMacro(identifierToken, spell, m))) + continue; - // the macro expansion generated something that looks like - // a function-like macro. - } + // the macro expansion generated something that looks like + // a function-like macro. + } - // `m' is function-like macro. - if (_dot->is(T_LPAREN)) { - QVector<MacroArgumentReference> actuals; - collectActualArguments(&actuals); + // `m' is function-like macro. + if (_dot->is(T_LPAREN)) { + QVector<MacroArgumentReference> actuals; + collectActualArguments(&actuals); - if (_dot->is(T_RPAREN)) { - expandFunctionLikeMacro(identifierToken, m, actuals); - continue; - } + if (_dot->is(T_RPAREN)) { + expandFunctionLikeMacro(identifierToken, m, actuals); + continue; } } } + // it's not a function or object-like macro. out(spell); } @@ -1390,6 +1383,12 @@ bool Preprocessor::isQtReservedWord(const QByteArray ¯oId) const return true; else if (size == 3 && macroId.at(0) == 'Q' && macroId == "Q_Q") return true; + else if (size == 10 && macroId.at(0) == 'Q' && macroId == "Q_PROPERTY") + return true; + else if (size == 7 && macroId.at(0) == 'Q' && macroId == "Q_ENUMS") + return true; + else if (size == 7 && macroId.at(0) == 'Q' && macroId == "Q_FLAGS") + return true; else if (size == 6 && macroId.at(0) == 'S' && macroId == "SIGNAL") return true; else if (size == 4 && macroId.at(0) == 'S' && macroId == "SLOT") |