From 5d83f44baa49fbeadb9b5c35cb15e3f8a860802f Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 4 Aug 1999 20:39:33 +0000 Subject: cpphash.c (macroexpand): Delete leading whitespace when arg is concatenated before. Wed Aug 4 13:29:23 1999 Zack Weinberg * cpphash.c (macroexpand): Delete leading whitespace when arg is concatenated before. (unsafe_chars): Correct test for whether + and - can extend a token. * cppinit.c (cpp_start_read): Do dependencies for -include/-imacros files also. * cpplib.c (cpp_scan_buffer): In no-output mode, don't bother tokenizing non-directive lines. (cpp_expand_to_buffer): Temporarily disable no-output mode. * cppmain.c: In no-output mode, just call cpp_scan_buffer for the input file. From-SVN: r28512 --- gcc/cppmain.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'gcc/cppmain.c') diff --git a/gcc/cppmain.c b/gcc/cppmain.c index 0d891f8..e2b5614 100644 --- a/gcc/cppmain.c +++ b/gcc/cppmain.c @@ -81,12 +81,12 @@ main (argc, argv) else if (! freopen (opts->out_fname, "w", stdout)) cpp_pfatal_with_name (&parse_in, opts->out_fname); - do + if (! opts->no_output) { - kind = cpp_get_token (&parse_in); - if (CPP_WRITTEN (&parse_in) >= BUFSIZ || kind == CPP_EOF) + do { - if (! opts->no_output) + kind = cpp_get_token (&parse_in); + if (CPP_WRITTEN (&parse_in) >= BUFSIZ || kind == CPP_EOF) { size_t rem, count = CPP_WRITTEN (&parse_in); @@ -94,12 +94,22 @@ main (argc, argv) if (rem < count) /* Write error. */ cpp_pfatal_with_name (&parse_in, opts->out_fname); - } - CPP_SET_WRITTEN (&parse_in, 0); + CPP_SET_WRITTEN (&parse_in, 0); + } + } + while (kind != CPP_EOF); + } + else + { + do + { + cpp_scan_buffer (&parse_in); + kind = cpp_get_token (&parse_in); } + while (kind != CPP_EOF); + CPP_SET_WRITTEN (&parse_in, 0); } - while (kind != CPP_EOF); cpp_finish (&parse_in); if (fwrite (parse_in.token_buffer, 1, CPP_WRITTEN (&parse_in), stdout) -- cgit v1.1