spvxml-helpers: Avoid warning on recent versions of libxml2.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 6 Nov 2022 18:42:51 +0000 (10:42 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 6 Nov 2022 18:48:58 +0000 (10:48 -0800)
src/output/spv/spvxml-helpers.c

index 825c24c89b067c46009737695469b101cd7206c9..652b60e3a6a517ca8520759cfefe077de1653c94 100644 (file)
@@ -77,7 +77,13 @@ xml_element_type_to_string (xmlElementType type)
     case XML_NAMESPACE_DECL: return "namespace declaration";
     case XML_XINCLUDE_START: return "XInclude start";
     case XML_XINCLUDE_END: return "XInclude end";
+
+#ifndef XML_DOCB_DOCUMENT_NODE
+      /* libxml2 removed this value from the enum and redefined it as a macro
+         for backward compatibility.  When it's not in the enum, it's best not
+         to have a 'case' for it because that provokes a compiler warning. */
     case XML_DOCB_DOCUMENT_NODE: return "docb document";
+#endif
     default: return "<error>";
     }
 }