aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-02-06 08:24:22 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-02-06 08:24:22 +0000
commiteaefae0ec35904e854d4f8a097fdb3e7c678aff8 (patch)
treeb4662b68daf63cc7cf16c2fab569a5dde8daa2ea /gcc/cpphash.c
parent1316f1f7fcb21e1f5c807f2a3a84f177674e0e5b (diff)
downloadgcc-eaefae0ec35904e854d4f8a097fdb3e7c678aff8.zip
gcc-eaefae0ec35904e854d4f8a097fdb3e7c678aff8.tar.gz
gcc-eaefae0ec35904e854d4f8a097fdb3e7c678aff8.tar.bz2
cppfiles.c (read_and_prescan): Bump input pointer before possibly branching off to the backslash code.
* cppfiles.c (read_and_prescan) [case SPECCASE_QUESTION]: Bump input pointer before possibly branching off to the backslash code. * cpphash.c (macroexpand): Correctly delete \r escapes when stringifying parameters. * cpplib.c (copy_rest_of_line): Go directly to skip_block_comment if we can; bail out early if we hit a line comment. (handle_directive): Treat '# 123' in an .S file just like '# <punctuation>'. Discard the shifted '#' if we hit '#\n'. Return 1 for '# not_a_directive'. (get_directive_token): Pop macro buffers here, so that cpp_get_token can't sneakily move past a newline. Add sanity checks. (cpp_get_token): goto randomchar if handle_directive returns 0. From-SVN: r31819
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index c2244c9..64491c5 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -1158,18 +1158,17 @@ macroexpand (pfile, hp)
if (!in_string)
{
+ /* Delete "\r " and "\r-" escapes. */
+ if (c == '\r')
+ {
+ i++;
+ continue;
+ }
/* Internal sequences of whitespace are
replaced by one space except within
a string or char token. */
- if (is_space(c))
+ else if (is_space(c))
{
- if (CPP_WRITTEN (pfile) > (unsigned) arg->stringified
- && (CPP_PWRITTEN (pfile))[-1] == '\r')
- {
- /* "\r " escape markers are removed */
- CPP_ADJUST_WRITTEN (pfile, -1);
- continue;
- }
if (need_space == 0)
need_space = 1;
continue;