diff options
| author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-10 17:20:30 +0000 |
|---|---|---|
| committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-10 17:20:30 +0000 |
| commit | fd34c6789ca5e78f1a92ff344335c44573c0de20 (patch) | |
| tree | 3647064a5aa3fefaeb653cfe1fe72a31f0f47578 /gcc/cppmain.c | |
| parent | 363600c8f143d2ec80edfd50841c6a3d1dceb419 (diff) | |
| download | ppe42-gcc-fd34c6789ca5e78f1a92ff344335c44573c0de20.tar.gz ppe42-gcc-fd34c6789ca5e78f1a92ff344335c44573c0de20.zip | |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54446 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppmain.c')
| -rw-r--r-- | gcc/cppmain.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cppmain.c b/gcc/cppmain.c index b04e86f2695..a5487e7cba3 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. */ |

