aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmain.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2002-06-10 17:20:30 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-06-10 17:20:30 +0000
commitafb03408e0b8683bced2c82adfe6c7d4524a9845 (patch)
tree3647064a5aa3fefaeb653cfe1fe72a31f0f47578 /gcc/cppmain.c
parent2754d3c5acdcddf405360d38a9c071c0280c06ce (diff)
downloadgcc-afb03408e0b8683bced2c82adfe6c7d4524a9845.zip
gcc-afb03408e0b8683bced2c82adfe6c7d4524a9845.tar.gz
gcc-afb03408e0b8683bced2c82adfe6c7d4524a9845.tar.bz2
cpphash.h (_cpp_read_logical_line_trad, [...]): Update prototypes.
* cpphash.h (_cpp_read_logical_line_trad, _cpp_expansions_different_trad): Update prototypes. * cpplex.c (continue_after_nul): New. * cppmain.c: Include cpphash.h. (scan_translation_unit_trad): New. (cpp_preprocess_file): Call it. * cpptrad.c (_cpp_read_logical_line_trad): Take new parameter overlay. (_cpp_expansions_different_trad): Update prototype. From-SVN: r54446
Diffstat (limited to 'gcc/cppmain.c')
-rw-r--r--gcc/cppmain.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cppmain.c b/gcc/cppmain.c
index b04e86f..a5487e7 100644
--- a/gcc/cppmain.c
+++ b/gcc/cppmain.c
@@ -24,6 +24,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "config.h"
#include "system.h"
#include "cpplib.h"
+#include "cpphash.h"
#include "intl.h"
/* Encapsulates state used to convert the stream of tokens coming from
@@ -42,6 +43,7 @@ static void setup_callbacks PARAMS ((cpp_reader *));
/* General output routines. */
static void scan_translation_unit PARAMS ((cpp_reader *));
+static void scan_translation_unit_trad PARAMS ((cpp_reader *));
static void check_multiline_token PARAMS ((const cpp_string *));
static int dump_macro PARAMS ((cpp_reader *, cpp_hashnode *, void *));
@@ -104,6 +106,8 @@ cpp_preprocess_file (pfile)
cpp_scan_nooutput or cpp_get_token next. */
if (options->no_output)
cpp_scan_nooutput (pfile);
+ else if (options->traditional)
+ scan_translation_unit_trad (pfile);
else
scan_translation_unit (pfile);
@@ -217,6 +221,22 @@ check_multiline_token (str)
print.line++;
}
+static void
+scan_translation_unit_trad (pfile)
+ cpp_reader *pfile;
+{
+ bool more;
+ size_t len;
+
+ do
+ {
+ 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);
+ }
+ while (more);
+}
+
/* If the token read on logical line LINE needs to be output on a
different line to the current one, output the required newlines or
a line marker, and return 1. Otherwise return 0. */