1From 702988467d67c3a33255de4c543f56767c64c72e Mon Sep 17 00:00:00 2001
2From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
3Date: Sat, 23 Dec 2023 21:30:30 +0100
4Subject: [PATCH] Fix build issues with libxml2 2.12
5
6Based on initial work from Bernd Kuhls <bernd@kuhls.net>, improved by
7Yaakov Selkowitz.
8
9Upstream: https://sourceforge.net/p/xmlstar/patches/22/
10Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
11---
12 src/trans.h      | 1 +
13 src/xml.c        | 2 +-
14 src/xml_edit.c   | 1 +
15 src/xml_elem.c   | 2 +-
16 src/xml_format.c | 1 +
17 src/xmlstar.h    | 2 +-
18 6 files changed, 6 insertions(+), 3 deletions(-)
19
20diff --git a/src/trans.h b/src/trans.h
21index 016304e..395462c 100644
22--- a/src/trans.h
23+++ b/src/trans.h
24@@ -36,6 +36,7 @@ THE SOFTWARE.
25 #include <libxml/xinclude.h>
26 #include <libxml/parserInternals.h>
27 #include <libxml/uri.h>
28+#include <libxml/globals.h>
29
30 #include <libxslt/xslt.h>
31 #include <libxslt/xsltInternals.h>
32diff --git a/src/xml.c b/src/xml.c
33index cf47cc2..e6f19c1 100644
34--- a/src/xml.c
35+++ b/src/xml.c
36@@ -104,7 +104,7 @@ void reportGenericError(void* ctx, const char * msg, ...) {
37 /* by default all errors are reported */
38 static ErrorInfo errorInfo = { NULL, NULL, VERBOSE, CONTINUE };
39
40-void reportError(void *ptr, xmlErrorPtr error)
41+void reportError(void *ptr, const xmlError *error)
42 {
43     ErrorInfo *errorInfo = (ErrorInfo*) ptr;
44     assert(errorInfo);
45diff --git a/src/xml_edit.c b/src/xml_edit.c
46index e199178..b3da8a4 100644
47--- a/src/xml_edit.c
48+++ b/src/xml_edit.c
49@@ -42,6 +42,7 @@ THE SOFTWARE.
50 #include <libxml/xpointer.h>
51 #include <libxml/parserInternals.h>
52 #include <libxml/uri.h>
53+#include <libxml/globals.h>
54 #include <libexslt/exslt.h>
55
56 #include "xmlstar.h"
57diff --git a/src/xml_elem.c b/src/xml_elem.c
58index 024e62a..a73038a 100644
59--- a/src/xml_elem.c
60+++ b/src/xml_elem.c
61@@ -186,7 +186,7 @@ typedef struct {
62  * put @name into @data->array[@data->offset]
63  */
64 static void
65-hash_key_put(void *payload, void *data, xmlChar *name)
66+hash_key_put(void *payload, void *data, const xmlChar *name)
67 {
68     ArrayDest *dest = data;
69     dest->array[dest->offset++] = name;
70diff --git a/src/xml_format.c b/src/xml_format.c
71index e9da4df..ddd6614 100644
72--- a/src/xml_format.c
73+++ b/src/xml_format.c
74@@ -42,6 +42,7 @@ THE SOFTWARE.
75 #include <libxml/xpointer.h>
76 #include <libxml/parserInternals.h>
77 #include <libxml/uri.h>
78+#include <libxml/globals.h>
79
80 #include "xmlstar.h"
81
82diff --git a/src/xmlstar.h b/src/xmlstar.h
83index 3e1eed3..e8d7177 100644
84--- a/src/xmlstar.h
85+++ b/src/xmlstar.h
86@@ -32,7 +32,7 @@ typedef struct _errorInfo {
87     ErrorStop stop;
88 } ErrorInfo;
89
90-void reportError(void *ptr, xmlErrorPtr error);
91+void reportError(void *ptr, const xmlError *error);
92 void suppressErrors(void);
93
94 typedef struct _gOptions {
95--
962.43.0
97
98