summaryrefslogtreecommitdiff
blob: a523bad41a30d6280c3342ef33b3c5fad9ba6dbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Bug: https://bugs.gentoo.org/922445

The change in libxml2 is not backwards compatibe.
A patch like the one in arch does not work with 2.11, so just cast the argument to maintain compatibility with both.

The upstream change is in include/libxml/xmlerror.h:

 typedef xmlError *xmlErrorPtr;

-typedef void (*xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error);
+typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);

See also: https://gitlab.archlinux.org/archlinux/packaging/packages/virtualbox/-/blob/main/019-libxml-2-12.patch?ref_type=heads

--- a/src/VBox/Runtime/r3/xml.cpp
+++ b/src/VBox/Runtime/r3/xml.cpp
@@ -1870,7 +1870,7 @@
         throw std::bad_alloc();
     /* per-thread so it must be here */
     xmlSetGenericErrorFunc(NULL, xmlParserBaseGenericError);
-    xmlSetStructuredErrorFunc(NULL, xmlParserBaseStructuredError);
+    xmlSetStructuredErrorFunc(NULL, (xmlStructuredErrorFunc)xmlParserBaseStructuredError);
 }
 
 XmlParserBase::~XmlParserBase()
@@ -1931,7 +1931,7 @@
                                                   pcszFilename,
                                                   NULL,       // encoding = auto
                                                   options)))
-        throw XmlError(xmlCtxtGetLastError(m_ctxt));
+        throw XmlError((xmlErrorPtr)xmlCtxtGetLastError(m_ctxt));
 
     doc.refreshInternals();
 }
@@ -2191,7 +2191,7 @@
                                               pcszFilename,
                                               NULL,       // encoding = auto
                                               options)))
-        throw XmlError(xmlCtxtGetLastError(m_ctxt));
+        throw XmlError((xmlErrorPtr)xmlCtxtGetLastError(m_ctxt));
 
     doc.refreshInternals();
 }