Skip to content

Commit 7b253e7

Browse files
committed
bump simplecpp to 1a3a3e9
1 parent 36ad0a0 commit 7b253e7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

externals/simplecpp/simplecpp.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,11 +1457,15 @@ class Macro {
14571457
Token *B = tok->next->next;
14581458
std::string strAB;
14591459

1460+
const bool varargs = variadic && args.size() >= 1U && B->str == args[args.size()-1U];
1461+
14601462
TokenList tokensB(files);
14611463
if (expandArg(&tokensB, B, parametertokens)) {
14621464
if (tokensB.empty())
14631465
strAB = A->str;
1464-
else {
1466+
else if (varargs && A->op == ',') {
1467+
strAB = ",";
1468+
} else {
14651469
strAB = A->str + tokensB.cfront()->str;
14661470
tokensB.deleteToken(tokensB.front());
14671471
}
@@ -1470,7 +1474,7 @@ class Macro {
14701474
}
14711475

14721476
bool removeComma = false;
1473-
if (variadic && strAB == "," && tok->previous->str == "," && args.size() >= 1U && B->str == args[args.size()-1U])
1477+
if (varargs && tokensB.empty() && tok->previous->str == ",")
14741478
removeComma = true;
14751479

14761480
output->deleteToken(A);

0 commit comments

Comments
 (0)