You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by tr...@apache.org on 2025/05/20 08:24:49 UTC
(openoffice) 02/02: Fix build with libxml2 >= 2.12.0
This is an automated email from the ASF dual-hosted git repository.
truckman pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 523491489b0a7126864a6de1be3e6e170549602a
Author: Don Lewis <tr...@apache.org>
AuthorDate: Tue May 20 01:22:28 2025 -0700
Fix build with libxml2 >= 2.12.0
libxml2 2.12.0 added const to one of the arguments of the error
callback function, changing its signature. Check the libxml2 version
so the function definition uses the proper type to fix the build
breakage.
---
main/unoxml/source/xpath/xpathapi.cxx | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/main/unoxml/source/xpath/xpathapi.cxx b/main/unoxml/source/xpath/xpathapi.cxx
index f64b21354c..32b4b6394c 100644
--- a/main/unoxml/source/xpath/xpathapi.cxx
+++ b/main/unoxml/source/xpath/xpathapi.cxx
@@ -267,7 +267,11 @@ namespace XPath
return selectSingleNode(contextNode, expr);
}
- static OUString make_error_message(xmlErrorPtr pError)
+#if LIBXML_VERSION >= 21200
+ static OUString make_error_message(const xmlError *pError)
+#else
+ static OUString make_error_message(xmlError *pError)
+#endif
{
::rtl::OUStringBuffer buf;
if (pError->message) {
@@ -312,7 +316,11 @@ namespace XPath
OSL_ENSURE(sal_False, msg.getStr());
}
- static void structured_error_func(void * userData, xmlErrorPtr error)
+#if LIBXML_VERSION >= 21200
+ static void structured_error_func(void * userData, const xmlError *error)
+#else
+ static void structured_error_func(void * userData, xmlError *error)
+#endif
{
(void) userData;
::rtl::OUStringBuffer buf(