From c6dc756d4e6905df8498596f5bd0c5a6aa1c6d24 Mon Sep 17 00:00:00 2001 From: seyko Date: Fri, 15 Apr 2016 17:15:11 +0300 Subject: preprocessor oprtion -C (keep comments) This is done by impression of the pcc -C option. Usual execution path and speed are not changed. --- tcc.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'tcc.c') diff --git a/tcc.c b/tcc.c index 722bd4c..e79e1fb 100644 --- a/tcc.c +++ b/tcc.c @@ -98,8 +98,9 @@ static void help(void) " -Dsym[=val] define 'sym' with value 'val'\n" " -Usym undefine 'sym'\n" " -E preprocess only\n" - " -P[1] no/alternative output of #line directives with -E\n" - " -d{D|M} dump defines (only with -E)\n" + " -P[1] no/alternative output of #line directives\n" + " -d{D|M} dump defines\n" + " -C keep comments\n" "Linker options:\n" " -Ldir add library path 'dir'\n" " -llib link with dynamic or static library 'lib'\n" @@ -294,19 +295,6 @@ int main(int argc, char **argv) } } - if (s->output_type == TCC_OUTPUT_PREPROCESS) { - if (!s->outfile) { - s->ppfp = stdout; - } else { - s->ppfp = fopen(s->outfile, "w"); - 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); /* compile or add each files or library */ -- cgit v1.3.1