summaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-07-31 23:47:19 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-07-31 23:47:19 +0000
commitc2cce4244f8a809a4d62de91c73a16448d491d0a (patch)
tree09f352803e0788fc35ed3daa9f4930ebd0f0d29b /gcc/cppmacro.c
parent509f4458814df1933978392312ba5e6cd7daa44e (diff)
downloadgcc-c2cce4244f8a809a4d62de91c73a16448d491d0a.tar.gz
2000-07-31 Jakub Jelinek <jakub@redhat.com>
* cpplex.c (_cpp_get_line): If index is 0, return line 0 col 0. (_cpp_get_token): Don't macro expand a just pasted token if it was pasted at no_expand_level. * testsuite/gcc.dg/cpp/paste7.c: New test. 2000-07-31 Zack Weinberg <zack@wolery.cumb.org> * cppmacro.c (find_param, count_params, save_expansion): Permit 'defined' as a macro parameter name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35394 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r--gcc/cppmacro.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index 03a9a99659d..8d53baf71f6 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -72,7 +72,7 @@ find_param (first, token)
unsigned int param = 0;
for (; first < token && first->type != CPP_CLOSE_PAREN; first++)
- if (first->type == CPP_NAME)
+ if (first->type == CPP_NAME || first->type == CPP_DEFINED)
{
param++;
if (first->val.node == token->val.node)
@@ -139,6 +139,8 @@ count_params (pfile, info)
case CPP_COMMENT:
continue; /* Ignore -C comments. */
+ case CPP_DEFINED: /* 'defined' may be used as a macro
+ parameter name. */
case CPP_NAME:
if (prev_ident)
{
@@ -429,7 +431,7 @@ save_expansion (pfile, info)
dumping macro definitions. They must go first. */
if (list->params_len)
for (token = info->first_param; token < info->first; token++)
- if (token->type == CPP_NAME)
+ if (token->type == CPP_NAME || token->type == CPP_DEFINED)
{
/* Copy null too. */
memcpy (buf, token->val.node->name, token->val.node->length + 1);
@@ -443,6 +445,7 @@ save_expansion (pfile, info)
switch (token->type)
{
+ case CPP_DEFINED:
case CPP_NAME:
if (list->paramc == -1)
break;