aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
authorVlad Vissoultchev <wqweto@gmail.com>2016-04-06 18:57:11 +0300
committerVlad Vissoultchev <wqweto@gmail.com>2016-04-06 18:57:11 +0300
commite946eb2a4109e0de5f8514457f851897a4824c3e (patch)
treeb5b0b86b298e2d2c8bb5cb78e1573d10978de43e /tcc.c
parent0691b7630b89bf3de5f7691802cb923bd7c1fd99 (diff)
downloadtinycc-e946eb2a4109e0de5f8514457f851897a4824c3e.tar.gz
tinycc-e946eb2a4109e0de5f8514457f851897a4824c3e.tar.bz2
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.
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c3
1 files changed, 3 insertions, 0 deletions
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);