Local tweaks to ucpp for xrdb:

- exit on the 1st error it finds. Better than stopping processing input
- accept -P as a synonym for -l since this is what xrdb uses to suppress
  #line markers.
This commit is contained in:
matthieu 2014-07-12 14:32:55 +00:00
parent f5aa946dbd
commit cf1d97d9e6
2 changed files with 4 additions and 1 deletions

View File

@ -115,6 +115,7 @@ void ucpp_error(long line, char *fmt, ...)
freemem(sc);
}
va_end(ap);
exit(1);
}
/*
@ -2418,6 +2419,8 @@ static int parse_opt(int argc, char *argv[], struct lexer_state *ls)
ls->flags &= ~FAIL_SHARP;
} else if (!strcmp(argv[i], "-l")) {
ls->flags &= ~LINE_NUM;
} else if (!strcmp(argv[i], "-P")) {
ls->flags &= ~LINE_NUM;
} else if (!strcmp(argv[i], "-lg")) {
ls->flags |= GCC_LINE_NUM;
} else if (!strcmp(argv[i], "-M")) {

View File

@ -27,7 +27,7 @@ keep comments in the output.
if a rogue '#' is encountered, do not emit an error and keep it in
the output.
.TP
.BI \-l
.B \-l, \-P
supress the emission of '#line' directives in the output.
.TP
.BI \-lg