]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix compilation error with libxml2 >= 2.12.0 and gcc >= 14.
authorBruno Haible <bruno@clisp.org>
Sun, 1 Dec 2024 18:35:51 +0000 (19:35 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 1 Dec 2024 18:35:51 +0000 (19:35 +0100)
Reported by Sam James <sam@gentoo.org>
at <https://savannah.gnu.org/bugs/?66506>.

* gettext-tools/src/its.c: Include <libxml/xmlversion.h>.
(structured_error): Adapt to API change.

gettext-tools/src/its.c

index 8ee7ab40f3384fe07174deffd0bda4164f3ddcd2..3f28f885127b1fd70419e679f6b07032a2c0f19f 100644 (file)
@@ -28,6 +28,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 
+#include <libxml/xmlversion.h>
 #include <libxml/xmlerror.h>
 #include <libxml/tree.h>
 #include <libxml/parser.h>
 /* ----------------------------- Error handling ----------------------------- */
 
 static void
+/* Adapt to API change in libxml 2.12.0.
+   See <https://gitlab.gnome.org/GNOME/libxml2/-/issues/622>.  */
+#if LIBXML_VERSION >= 21200
+structured_error (void *data, const xmlError *err)
+#else
 structured_error (void *data, xmlError *err)
+#endif
 {
   error (0, err->level == XML_ERR_FATAL ? EXIT_FAILURE : 0,
          _("%s error: %s"), "libxml2", err->message);