ensure #define statements don't propagate comments as well

This commit is contained in:
Jeremiah Orians 2022-01-22 11:45:01 -05:00
parent 781fdeee18
commit a6397e7eb7
No known key found for this signature in database
GPG Key ID: 6B3A3F198708F894
1 changed files with 17 additions and 0 deletions

View File

@ -548,6 +548,23 @@ void handle_define()
expansion_end->next = NULL;
return;
}
else if(('/' == macro_token->s[0]) && ('*' == macro_token->s[1]))
{
eat_current_token();
continue;
}
else if(('/' == macro_token->s[0]) && ('/' == macro_token->s[1]))
{
macro_token->s = "\n";
if(NULL == expansion_end)
{
hold->expansion = NULL;
expansion_end = macro_token;
return;
}
expansion_end->next = NULL;
return;
}
if(NULL == hold)
{