Implement -dM preprocessor option as in gcc

There was already support for -dD option but in contrast -dM dumps only `#define` directives w/o actual preprocessor output.

The original -dD output differs from gcc output by additional comment in front of `#define`s so this quirk is left for -dM as well.
This commit is contained in:
Vlad Vissoultchev
2016-04-06 18:57:11 +03:00
parent 0691b7630b
commit e946eb2a41
4 changed files with 14 additions and 8 deletions

3
tcc.h
View File

@ -712,7 +712,8 @@ struct TCCState {
LINE_MACRO_OUTPUT_FORMAT_NONE,
LINE_MACRO_OUTPUT_FORMAT_STD
} Pflag; /* -P switch */
int dflag; /* -dX value */
char dflag; /* -dX value */
FILE *dffp;
/* for -MD/-MF: collected dependencies for this compilation */
char **target_deps;