Skip to content

Commit f188ea3

Browse files
committed
bump simplecpp
1 parent ebb3912 commit f188ea3

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

externals/simplecpp/simplecpp.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,8 @@ namespace simplecpp {
11791179
++par;
11801180
else if (rawtok->op == ')')
11811181
--par;
1182+
else if (rawtok->op == '#' && !sameline(rawtok->previous, rawtok))
1183+
throw Error(rawtok->location, "it is invalid to use a preprocessor directive as macro parameter");
11821184
rawtokens2.push_back(new Token(rawtok->str, rawtok1->location));
11831185
rawtok = rawtok->next;
11841186
}
@@ -2313,10 +2315,13 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
23132315
}
23142316

23152317
if (rawtok->op == '#' && !sameline(rawtok->previous, rawtok)) {
2318+
if (!sameline(rawtok, rawtok->next)) {
2319+
rawtok = rawtok->next;
2320+
continue;
2321+
}
23162322
rawtok = rawtok->next;
2317-
if (!rawtok || !rawtok->name) {
2318-
if (rawtok)
2319-
rawtok = gotoNextLine(rawtok);
2323+
if (!rawtok->name) {
2324+
rawtok = gotoNextLine(rawtok);
23202325
continue;
23212326
}
23222327

0 commit comments

Comments
 (0)