From e946eb2a4109e0de5f8514457f851897a4824c3e Mon Sep 17 00:00:00 2001 From: Vlad Vissoultchev Date: Wed, 6 Apr 2016 18:57:11 +0300 Subject: 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. --- tcc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tcc.c') diff --git a/tcc.c b/tcc.c index 9daf6e6..95e1a15 100644 --- a/tcc.c +++ b/tcc.c @@ -301,6 +301,9 @@ int main(int argc, char **argv) if (!s->ppfp) tcc_error("could not write '%s'", s->outfile); } + s->dffp = s->ppfp; + if (s->dflag == 'M') + s->ppfp = NULL; } tcc_set_output_type(s, s->output_type); -- cgit v1.3.1