summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/preprocessor.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-03-06 00:11:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-06 00:11:52 +0100
commitb86106387350f673a20d3b0a2413023f6205169b (patch)
tree2dfc079f1eecbbf9fde8733430a3a1e2f04d9a42 /src/tools/moc/preprocessor.cpp
parent88918abddeb323340c4a49dda035898a740373da (diff)
parent5e8ae03578ecd0538a774505f2f7e2fc626b0ab7 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/tools/moc/preprocessor.cpp')
-rw-r--r--src/tools/moc/preprocessor.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index 96b920b7cd..8f4b84a9c8 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.org>
** Contact: http://www.qt-project.org/legal
**
** This file is part of the tools applications of the Qt Toolkit.
@@ -536,12 +537,14 @@ static Symbols tokenize(const QByteArray &input, int lineNum = 1, TokenizeMode m
return symbols;
}
-Symbols Preprocessor::macroExpand(Preprocessor *that, Symbols &toExpand, int &index, int lineNum, bool one)
+Symbols Preprocessor::macroExpand(Preprocessor *that, Symbols &toExpand, int &index,
+ int lineNum, bool one, const QSet<QByteArray> &excludeSymbols)
{
SymbolStack symbols;
SafeSymbols sf;
sf.symbols = toExpand;
sf.index = index;
+ sf.excludedSymbols = excludeSymbols;
symbols.push(sf);
Symbols result;
@@ -664,7 +667,7 @@ Symbols Preprocessor::macroExpandIdentifier(Preprocessor *that, SymbolStack &sym
if (i == macro.symbols.size() - 1 || macro.symbols.at(i + 1).token != PP_HASHHASH) {
Symbols arg = arguments.at(index);
int idx = 1;
- expansion += macroExpand(that, arg, idx, lineNum, false);
+ expansion += macroExpand(that, arg, idx, lineNum, false, symbols.excludeSymbols());
} else {
expansion += arguments.at(index);
}