diff options
author | albert-github <albert.tests@gmail.com> | 2019-07-05 16:12:36 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-07-05 16:12:36 (GMT) |
commit | 1ebd69065f085322e4cf00ccb1ce233df852780a (patch) | |
tree | d3b2d006185e3446c7e8340ec63e44317e16fddc /src/pre.l | |
parent | 4a42645a32b579f9b2713031e45fd610b1e21f48 (diff) | |
download | Doxygen-1ebd69065f085322e4cf00ccb1ce233df852780a.zip Doxygen-1ebd69065f085322e4cf00ccb1ce233df852780a.tar.gz Doxygen-1ebd69065f085322e4cf00ccb1ce233df852780a.tar.bz2 |
issue #7104 Warning with preprocessor
The test on 'defined' has to be done earlier as otherwise the replacement (limited to 2 defined is enough for the test) of
```
(defined(__AVR_ATmega644RFR2__)||defined(__AVR_ATmega256RFR2__))
```
will be
```
` ! (defined( 0 )||0( 0 )) '
```
instead of
```
` ! (defined( 0 )||defined( 0 )) '
```
Diffstat (limited to 'src/pre.l')
-rw-r--r-- | src/pre.l | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1089,7 +1089,12 @@ static void expandExpression(QCString &expr,QCString *rest,int pos) if (g_expandedDict->find(macroName)==0) // expand macro { Define *def=DefineManager::instance().isDefined(macroName); - if (definedTest) // macro name was found after defined + if (macroName=="defined") + { + //printf("found defined inside macro definition '%s'\n",expr.right(expr.length()-p).data()); + definedTest=TRUE; + } + else if (definedTest) // macro name was found after defined { if (def) expMacro = " 1 "; else expMacro = " 0 "; replaced=TRUE; @@ -1118,11 +1123,6 @@ static void expandExpression(QCString &expr,QCString *rest,int pos) replaced=replaceFunctionMacro(expr,rest,p+l,len,def,expMacro); len+=l; } - else if (macroName=="defined") - { - //printf("found defined inside macro definition '%s'\n",expr.right(expr.length()-p).data()); - definedTest=TRUE; - } if (replaced) // expand the macro and rescan the expression { |