1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-28 06:30:16 +00:00

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

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) {