]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/cppmain.c
Makefile.in: Update cppmain.o.
[gcc.git] / gcc / cppmain.c
index a5487e7cba38a3592fe90a14f365ba90c7c78617..0edc3d2b25b86387b88d005a71c9ea377e2e6b43 100644 (file)
@@ -25,7 +25,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #include "system.h"
 #include "cpplib.h"
 #include "cpphash.h"
-#include "intl.h"
 
 /* Encapsulates state used to convert the stream of tokens coming from
    cpp_get_token back into a text file.  */
@@ -73,6 +72,10 @@ cpp_preprocess_file (pfile)
 {
   options = cpp_get_options (pfile);
 
+  /* Let preprocessor know if it's only preprocessing.  It would be
+     nice to lose this somehow.  */
+  options->preprocess_only = 1;
+
   /* Initialize the printer structure.  Setting print.line to -1 here
      is a trick to guarantee that the first token of the file will
      cause a linemarker to be output by maybe_print_line.  */
@@ -221,20 +224,22 @@ check_multiline_token (str)
       print.line++;
 }
 
+/* Writes out a traditionally preprocessed file.  */
 static void
 scan_translation_unit_trad (pfile)
      cpp_reader *pfile;
 {
-  bool more;
-  size_t len;
-
-  do
+  for (;;)
     {
-      more = _cpp_read_logical_line_trad (pfile, false);
-      len = pfile->trad_out_cur - pfile->trad_out_base;
-      fwrite (pfile->trad_out_base, 1, len, print.outf);
+      size_t len;
+
+      if (!_cpp_read_logical_line_trad (pfile))
+       break;
+      len = pfile->out.cur - pfile->out.base;
+      maybe_print_line (print.map, pfile->out.first_line);
+      fwrite (pfile->out.base, 1, len, print.outf);
+      print.printed = 1;
     }
-  while (more);
 }
 
 /* If the token read on logical line LINE needs to be output on a
This page took 0.029472 seconds and 5 git commands to generate.