Added a gcc preprocessor options -P, -P1

tcc -E -P
  do not output a #line directive, a gcc compatible option

tcc -E -P1
  don't follow a gcc preprocessor style and do output a standard
  #line directive. In such case we don't lose a location info when
  we going to compile a resulting file wtith a compiler not
  understanding a gnu style line info.
This commit is contained in:
seyko
2015-03-03 14:19:14 +03:00
parent 40418f87c7
commit 50cdccf3ef
4 changed files with 46 additions and 10 deletions

5
tcc.h
View File

@ -656,6 +656,11 @@ struct TCCState {
/* output file for preprocessing (-E) */
FILE *ppfp;
enum {
LINE_MACRO_OUTPUT_FORMAT_GCC,
LINE_MACRO_OUTPUT_FORMAT_NONE,
LINE_MACRO_OUTPUT_FORMAT_STD,
} Pflag;
/* for -MD/-MF: collected dependencies for this compilation */
char **target_deps;