+/* Undefine a single macro/assertion/whatever. */
+
+static int
+undefine_macros (cpp_reader *pfile, cpp_hashnode *h,
+ void *data_p ATTRIBUTE_UNUSED)
+{
+ switch (h->type)
+ {
+ case NT_VOID:
+ break;
+
+ case NT_MACRO:
+ if (pfile->cb.undef)
+ (*pfile->cb.undef) (pfile, pfile->directive_line, h);
+
+ if (CPP_OPTION (pfile, warn_unused_macros))
+ _cpp_warn_if_unused_macro (pfile, h, NULL);
+
+ /* And fall through.... */
+ case NT_ASSERTION:
+ _cpp_free_definition (h);
+ break;
+
+ default:
+ abort ();
+ }
+ h->flags &= ~NODE_POISONED;
+ return 1;
+}
+
+/* Undefine all macros and assertions. */
+
+void
+cpp_undef_all (cpp_reader *pfile)
+{
+ cpp_forall_identifiers (pfile, undefine_macros, NULL);
+}
+
+