mirror of
https://github.com/cc65/cc65.git
synced 2025-02-21 20:29:17 +00:00
Fixed line info for #pragma messages and diagnostics.
This commit is contained in:
parent
9f8bfb859c
commit
133507b031
@ -3025,6 +3025,7 @@ static int ParseDirectives (unsigned ModeFlags)
|
|||||||
if (!PPSkip) {
|
if (!PPSkip) {
|
||||||
if ((ModeFlags & MSM_IN_ARG_LIST) == 0) {
|
if ((ModeFlags & MSM_IN_ARG_LIST) == 0) {
|
||||||
DoPragma ();
|
DoPragma ();
|
||||||
|
return Whitespace;
|
||||||
} else {
|
} else {
|
||||||
PPError ("Embedded #pragma directive within macro arguments is unsupported");
|
PPError ("Embedded #pragma directive within macro arguments is unsupported");
|
||||||
}
|
}
|
||||||
@ -3153,16 +3154,12 @@ static void PreprocessDirective (StrBuf* Source, StrBuf* Target, unsigned ModeFl
|
|||||||
** whitespace and comments, then do macro replacement.
|
** whitespace and comments, then do macro replacement.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int OldIndex = SB_GetIndex (Source);
|
|
||||||
MacroExp E;
|
MacroExp E;
|
||||||
|
|
||||||
SkipWhitespace (0);
|
SkipWhitespace (0);
|
||||||
InitMacroExp (&E);
|
InitMacroExp (&E);
|
||||||
ReplaceMacros (Source, Target, &E, ModeFlags | MSM_IN_DIRECTIVE);
|
ReplaceMacros (Source, Target, &E, ModeFlags | MSM_IN_DIRECTIVE);
|
||||||
DoneMacroExp (&E);
|
DoneMacroExp (&E);
|
||||||
|
|
||||||
/* Restore the source input index */
|
|
||||||
SB_SetIndex (Source, OldIndex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3186,7 +3183,9 @@ void Preprocess (void)
|
|||||||
AddPreLine (PLine);
|
AddPreLine (PLine);
|
||||||
|
|
||||||
/* Add leading whitespace to prettify preprocessor output */
|
/* Add leading whitespace to prettify preprocessor output */
|
||||||
AppendIndent (PLine, SB_GetIndex (Line));
|
if (CurC != '\0') {
|
||||||
|
AppendIndent (PLine, SB_GetIndex (Line));
|
||||||
|
}
|
||||||
|
|
||||||
/* Expand macros if any */
|
/* Expand macros if any */
|
||||||
InitMacroExp (&E);
|
InitMacroExp (&E);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user