summaryrefslogtreecommitdiffstats
path: root/src/VBox/Runtime/r3/xml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Runtime/r3/xml.cpp')
-rw-r--r--src/VBox/Runtime/r3/xml.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/VBox/Runtime/r3/xml.cpp b/src/VBox/Runtime/r3/xml.cpp
index a6661760..f96d45f5 100644
--- a/src/VBox/Runtime/r3/xml.cpp
+++ b/src/VBox/Runtime/r3/xml.cpp
@@ -1856,12 +1856,20 @@ static void xmlParserBaseGenericError(void *pCtx, const char *pszMsg, ...) RT_NO
va_end(args);
}
+#if LIBXML_VERSION >= 21206
+static void xmlStructuredErrorFunc(void *userData, const xmlError *error) RT_NOTHROW_DEF
+{
+ NOREF(userData);
+ NOREF(error);
+}
+#else
static void xmlParserBaseStructuredError(void *pCtx, xmlErrorPtr error) RT_NOTHROW_DEF
{
NOREF(pCtx);
/* we expect that there is always a trailing NL */
LogRel(("XML error at '%s' line %d: %s", error->file, error->line, error->message));
}
+#endif
XmlParserBase::XmlParserBase()
{
@@ -1870,7 +1878,11 @@ XmlParserBase::XmlParserBase()
throw std::bad_alloc();
/* per-thread so it must be here */
xmlSetGenericErrorFunc(NULL, xmlParserBaseGenericError);
+#if LIBXML_VERSION >= 21206
+ xmlSetStructuredErrorFunc(NULL, xmlStructuredErrorFunc);
+#else
xmlSetStructuredErrorFunc(NULL, xmlParserBaseStructuredError);
+#endif
}
XmlParserBase::~XmlParserBase()
@@ -1931,7 +1943,7 @@ void XmlMemParser::read(const void *pvBuf, size_t cbSize,
pcszFilename,
NULL, // encoding = auto
options)))
- throw XmlError(xmlCtxtGetLastError(m_ctxt));
+ throw XmlError((xmlErrorPtr)xmlCtxtGetLastError(m_ctxt));
doc.refreshInternals();
}
@@ -2191,7 +2203,7 @@ void XmlFileParser::read(const RTCString &strFilename,
pcszFilename,
NULL, // encoding = auto
options)))
- throw XmlError(xmlCtxtGetLastError(m_ctxt));
+ throw XmlError((xmlErrorPtr)xmlCtxtGetLastError(m_ctxt));
doc.refreshInternals();
}