summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cppmacro.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2005-06-03 03:28:44 +0000
committerkan <kan@FreeBSD.org>2005-06-03 03:28:44 +0000
commit2156e40a831a8e0ab68e4bc091c2940bf46ca6df (patch)
treef0dc8ad34f9fcaf27052e24e893a4284b5fee6e9 /contrib/gcc/cppmacro.c
parent0a20abcc95340c9d2bb59421bac84eca4fb43b0c (diff)
downloadFreeBSD-src-2156e40a831a8e0ab68e4bc091c2940bf46ca6df.zip
FreeBSD-src-2156e40a831a8e0ab68e4bc091c2940bf46ca6df.tar.gz
Gcc 3.4.4 release.
Diffstat (limited to 'contrib/gcc/cppmacro.c')
-rw-r--r--contrib/gcc/cppmacro.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/gcc/cppmacro.c b/contrib/gcc/cppmacro.c
index 11ac09f..2298c85 100644
--- a/contrib/gcc/cppmacro.c
+++ b/contrib/gcc/cppmacro.c
@@ -1626,6 +1626,7 @@ cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node)
len += NODE_LEN (macro->params[i]) + 1; /* "," */
}
+ /* This should match below where we fill in the buffer. */
if (CPP_OPTION (pfile, traditional))
len += _cpp_replacement_text_len (macro);
else
@@ -1637,11 +1638,14 @@ cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node)
if (token->type == CPP_MACRO_ARG)
len += NODE_LEN (macro->params[token->val.arg_no - 1]);
else
- len += cpp_token_len (token) + 1; /* Includes room for ' '. */
+ len += cpp_token_len (token);
+
if (token->flags & STRINGIFY_ARG)
len++; /* "#" */
if (token->flags & PASTE_LEFT)
len += 3; /* " ##" */
+ if (token->flags & PREV_WHITE)
+ len++; /* " " */
}
}
@@ -1701,10 +1705,10 @@ cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node)
if (token->type == CPP_MACRO_ARG)
{
- len = NODE_LEN (macro->params[token->val.arg_no - 1]);
memcpy (buffer,
- NODE_NAME (macro->params[token->val.arg_no - 1]), len);
- buffer += len;
+ NODE_NAME (macro->params[token->val.arg_no - 1]),
+ NODE_LEN (macro->params[token->val.arg_no - 1]));
+ buffer += NODE_LEN (macro->params[token->val.arg_no - 1]);
}
else
buffer = cpp_spell_token (pfile, token, buffer);
OpenPOWER on IntegriCloud