summaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-25 19:32:36 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-25 19:32:36 +0000
commit6060326b958357944f740b769e1df80c2a2287e4 (patch)
tree5a047961b22821bc1f9f0aa156612fd5c002d95c /gcc/cpphash.c
parentbcfb5d028d423069fdcc08b3853467cb0c716f7d (diff)
downloadgcc-6060326b958357944f740b769e1df80c2a2287e4.tar.gz
2000-04-25 Zack Weinberg <zack@wolery.cumb.org>
* cpplib.h (struct cpp_buffer): Add 'mapped' flag; fix commentary. 2000-04-25 Neil Booth <NeilB@earthling.net> Restore previous patch, plus the following fixes: * cpphash.c (_cpp_create_definition): Test PREV_WHITESPACE in flags, not CPP_OPEN_PAREN. * cpplex.c (expand_token_space, init_token_list, cpp_free_token_list): Put the dummy token at list->tokens[-1]. (_cpp_lex_line, _cpp_lex_file): token list is 0-based. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33419 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 5817e964426..fe594a2dadc 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -459,7 +459,8 @@ collect_objlike_expansion (pfile, list)
default:;
}
- if (i > 1 && !last_was_paste && (list->tokens[i].flags & HSPACE_BEFORE))
+ if (i > 1 && !last_was_paste
+ && (list->tokens[i].flags & PREV_WHITESPACE))
CPP_PUTC (pfile, ' ');
CPP_PUTS (pfile,
@@ -571,10 +572,10 @@ collect_funlike_expansion (pfile, list, arglist, replacement)
}
if (last_token != PASTE && last_token != START
- && (list->tokens[i].flags & HSPACE_BEFORE))
+ && (list->tokens[i].flags & PREV_WHITESPACE))
CPP_PUTC (pfile, ' ');
if (last_token == ARG && CPP_TRADITIONAL (pfile)
- && !(list->tokens[i].flags & HSPACE_BEFORE))
+ && !(list->tokens[i].flags & PREV_WHITESPACE))
endpat->raw_after = 1;
switch (token)
@@ -616,7 +617,7 @@ collect_funlike_expansion (pfile, list, arglist, replacement)
{
int raw_before = (last_token == PASTE
|| (CPP_TRADITIONAL (pfile)
- && !(list->tokens[i].flags & HSPACE_BEFORE)));
+ && !(list->tokens[i].flags & PREV_WHITESPACE)));
add_pat (&pat, &endpat,
CPP_WRITTEN (pfile) - last /* nchars */, j /* argno */,
@@ -865,7 +866,7 @@ _cpp_create_definition (pfile, list, hp)
/* The macro is function-like only if the next character,
with no intervening whitespace, is '('. */
else if (list->tokens[1].type == CPP_OPEN_PAREN
- && ! (list->tokens[1].flags & HSPACE_BEFORE))
+ && ! (list->tokens[1].flags & PREV_WHITESPACE))
{
struct arglist args;
int replacement;
@@ -884,7 +885,7 @@ _cpp_create_definition (pfile, list, hp)
whitespace after the name (6.10.3 para 3). */
else
{
- if (! (list->tokens[1].flags & CPP_OPEN_PAREN))
+ if (! (list->tokens[1].flags & PREV_WHITESPACE))
cpp_pedwarn (pfile,
"The C standard requires whitespace after #define %s",
hp->name);