@@ -2046,13 +2046,20 @@ namespace simplecpp {
20462046 calledMacro.expand (&temp, loc, tok, macros, expandedmacros);
20472047 return recursiveExpandToken (output, temp, loc, tok, macros, expandedmacros2, parametertokens);
20482048 }
2049- if (!sameline (tok, tok->next ) || tok-> next -> op != ' ( ' ) {
2049+ if (!sameline (tok, tok->next )) {
20502050 output->push_back (newMacroToken (tok->str (), loc, true , tok));
20512051 return tok->next ;
20522052 }
20532053 TokenList tokens (files);
20542054 tokens.push_back (new Token (*tok));
2055- const Token * const tok2 = appendTokens (&tokens, loc, tok->next , macros, expandedmacros, parametertokens);
2055+ const Token * tok2 = nullptr ;
2056+ if (tok->next ->op == ' (' )
2057+ tok2 = appendTokens (&tokens, loc, tok->next , macros, expandedmacros, parametertokens);
2058+ else if (tok->next ->name && tok->next ->next && tok->next ->next ->op != ' (' ) {
2059+ expandToken (&tokens, loc, tok->next , macros, expandedmacros2, parametertokens);
2060+ if (tokens.cfront ()->next && tokens.cfront ()->next ->op == ' (' )
2061+ tok2 = tok->next ;
2062+ }
20562063 if (!tok2) {
20572064 output->push_back (newMacroToken (tok->str (), loc, true , tok));
20582065 return tok->next ;
0 commit comments