This allows use of macros in the file spec and is a requirement of the C
standard.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3803
b7a2c559-68d2-44c3-8de9-
860c34a00d81
UseLineInfo (SavedNextTok.LI);
}
UseLineInfo (SavedNextTok.LI);
}
-#if 0
- /* Remove the #if from the line */
- SkipWhitespace ();
- S = line;
- while (CurC != '\0') {
- *S++ = CurC;
- NextChar ();
- }
- *S = '\0';
-
- /* Start over parsing from line */
- InitLine (line);
-#endif
-
/* Switch into special preprocessing mode */
Preprocessing = 1;
/* Switch into special preprocessing mode */
Preprocessing = 1;
StrBuf Filename = STATIC_STRBUF_INITIALIZER;
StrBuf Filename = STATIC_STRBUF_INITIALIZER;
+ /* Preprocess the remainder of the line */
+ PreprocessLine ();
+
/* Skip blanks */
SkipWhitespace ();
/* Skip blanks */
SkipWhitespace ();
SB_Terminate (&Filename);
/* Check if we got a terminator */
SB_Terminate (&Filename);
/* Check if we got a terminator */
+ if (CurC == RTerm) {
+ /* Open the include file */
+ OpenIncludeFile (SB_GetConstBuf (&Filename), DirSpec);
+ } else if (CurC == '\0') {
/* No terminator found */
/* No terminator found */
- PPError ("Missing terminator or file name too long");
- goto Done;
+ PPError ("#include expects \"FILENAME\" or <FILENAME>");
- /* Open the include file */
- OpenIncludeFile (SB_GetConstBuf (&Filename), DirSpec);
-
Done:
/* Free the allocated filename data */
DoneStrBuf (&Filename);
Done:
/* Free the allocated filename data */
DoneStrBuf (&Filename);