Parse file included inside a macro at definition time

This commit is contained in:
Marco Aurelio da Costa 2021-04-26 13:30:54 -03:00 committed by Oliver Schmidt
parent 8e02f8f5ec
commit b9a3c78888
1 changed files with 16 additions and 0 deletions

View File

@ -510,6 +510,22 @@ void MacDef (unsigned Style)
}
}
if (CurTok.Tok == TOK_INCLUDE) {
/* Include another file */
NextTok ();
/* Name must follow */
if (CurTok.Tok != TOK_STRCON) {
ErrorSkip ("String constant expected");
} else {
SB_Terminate (&CurTok.SVal);
if (NewInputFile (SB_GetConstBuf (&CurTok.SVal)) == 0) {
/* Error opening the file, skip remainder of line */
SkipUntilSep ();
}
}
NextTok ();
}
/* Check for a .LOCAL declaration */
if (CurTok.Tok == TOK_LOCAL && Style == MAC_STYLE_CLASSIC) {