Skip to content

Commit

Permalink
EXPAND_AS_DEFINED not expanded recursively
Browse files Browse the repository at this point in the history
A  relates issue is:
EXPAND_ONLY_PREDEF neglected within function macro expansions (Origin: bugzilla 559489) doxygen#3165

During substitution we should also test whether or not the restrictions about `EXPAND_AS_DEFINED` and `EXPAND_ONLY_PREDEF `` are fulfilled.
  • Loading branch information
albert-github committed May 16, 2022
1 parent cd8d06b commit 73ba0ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pre.l
Expand Up @@ -2557,6 +2557,7 @@ static int getNextId(const QCString &expr,int p,int *l)
*/
static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,int pos,int level)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
//printf(">expandExpression(expr='%s',rest='%s',pos=%d,level=%d)\n",qPrint(expr),rest ? qPrint(*rest) : "", pos, level);
if (expr.isEmpty())
Expand Down Expand Up @@ -2590,6 +2591,7 @@ static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,in
if (state->expandedDict.find(macroName.str())==state->expandedDict.end()) // expand macro
{
Define *def=isDefined(yyscanner,macroName);
if (!(!yyextra->expandOnlyPredef || (def && def->isPredefined))) def = NULL;
if (macroName=="defined")
{
//printf("found defined inside macro definition '%s'\n",qPrint(expr.right(expr.length()-p)));
Expand Down

0 comments on commit 73ba0ab

Please sign in to comment.