swiften: fix build for libxml2 2.12

This commit is contained in:
oreo639 2024-02-19 05:43:29 -08:00
parent 8de145fae3
commit 62d7997fb3

View file

@ -0,0 +1,15 @@
diff -rup Swiften/Parser/LibXMLParser.cpp.orig Swiften/Parser/LibXMLParser.cpp
--- a/Swiften/Parser/LibXMLParser.cpp
+++ b/Swiften/Parser/LibXMLParser.cpp
@@ -97,7 +97,11 @@ bool LibXMLParser::parse(const std::stri
if (xmlParseChunk(p->context_, data.c_str(), boost::numeric_cast<int>(data.size()), false) == XML_ERR_OK) {
return true;
}
+#if LIBXML_VERSION >= 21200
+ const xmlError* error = xmlCtxtGetLastError(p->context_);
+#else
xmlError* error = xmlCtxtGetLastError(p->context_);
+#endif
if (error->code == XML_WAR_NS_URI || error->code == XML_WAR_NS_URI_RELATIVE) {
xmlCtxtResetLastError(p->context_);
p->context_->errNo = XML_ERR_OK;