aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-11-09 21:18:15 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-11-09 21:18:15 +0000
commita949941cf79dc2bee4e741ce3928e11c4053f257 (patch)
treefaf4076c83d65bd44e0d82d85813fd94e77029cf /gcc/cpphash.c
parent9a0662b4d5ca89808c149d69d271068ae0e54560 (diff)
downloadgcc-a949941cf79dc2bee4e741ce3928e11c4053f257.zip
gcc-a949941cf79dc2bee4e741ce3928e11c4053f257.tar.gz
gcc-a949941cf79dc2bee4e741ce3928e11c4053f257.tar.bz2
cpphash.c: Move cpp_defined here from cpplib.c.
* cpphash.c: Move cpp_defined here from cpplib.c. * cpplib.c: Update comments, move cpp_defined to cpphash.c. * cpplex.c (_cpp_lex_token): Don't leave the lexer at EOL. * cppmacro.c (cpp_get_token): Update comments, no need now to catch the CPP_EOF meaning EOL case. From-SVN: r37345
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 50172d1..4804c8f 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -281,3 +281,16 @@ cpp_forall_identifiers (pfile, cb, v)
}
while (++p < limit);
}
+
+/* Determine whether the identifier ID, of length LEN, is a defined macro. */
+int
+cpp_defined (pfile, id, len)
+ cpp_reader *pfile;
+ const U_CHAR *id;
+ int len;
+{
+ cpp_hashnode *hp = cpp_lookup (pfile, id, len);
+
+ /* If it's of type NT_MACRO, it cannot be poisoned. */
+ return hp->type == NT_MACRO;
+}