/* Hash tables for the CPP library.
- Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1998,
- 1999, 2000, 2001, 2002, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1986-2020 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
table = ht_create (13); /* 8K (=2^13) entries. */
table->alloc_node = alloc_node;
- _obstack_begin (&pfile->hash_ob, 0, 0,
- (void *(*) (long)) xmalloc,
- (void (*) (void *)) free);
+ obstack_specify_allocation (&pfile->hash_ob, 0, 0, xmalloc, free);
}
table->pfile = pfile;
s->n_false = cpp_lookup (pfile, DSC("false"));
s->n__VA_ARGS__ = cpp_lookup (pfile, DSC("__VA_ARGS__"));
s->n__VA_ARGS__->flags |= NODE_DIAGNOSTIC;
+ s->n__VA_OPT__ = cpp_lookup (pfile, DSC("__VA_OPT__"));
+ s->n__VA_OPT__->flags |= NODE_DIAGNOSTIC;
+ /* __has_include{,_next} are inited in cpp_init_builtins. */
}
/* Tear down the identifier hash table. */
node = CPP_HASHNODE (ht_lookup (pfile->hash_table, str, len, HT_NO_INSERT));
- /* If it's of type NT_MACRO, it cannot be poisoned. */
- return node && node->type == NT_MACRO;
+ /* If it's a macro, it cannot have been poisoned. */
+ return node && cpp_macro_p (node);
}
/* We don't need a proxy since the hash table's identifier comes first