aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmain.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@bitmover.com>1999-08-04 20:39:33 +0000
committerZack Weinberg <zack@gcc.gnu.org>1999-08-04 20:39:33 +0000
commit5d83f44baa49fbeadb9b5c35cb15e3f8a860802f (patch)
tree7dea07caa27d775c7af2d93e14dea09352a6d2e9 /gcc/cppmain.c
parent2a94e396c65da274a48a7d572d3e229dace92308 (diff)
downloadgcc-5d83f44baa49fbeadb9b5c35cb15e3f8a860802f.zip
gcc-5d83f44baa49fbeadb9b5c35cb15e3f8a860802f.tar.gz
gcc-5d83f44baa49fbeadb9b5c35cb15e3f8a860802f.tar.bz2
cpphash.c (macroexpand): Delete leading whitespace when arg is concatenated before.
Wed Aug 4 13:29:23 1999 Zack Weinberg <zack@bitmover.com> * 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
Diffstat (limited to 'gcc/cppmain.c')
-rw-r--r--gcc/cppmain.c24
1 files changed, 17 insertions, 7 deletions
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)