This is an automated email from the ASF dual-hosted git repository.
truckman pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO41X by this push:
new 60c8d5168e Fix build with libxml2 >= 2.12.0
60c8d5168e is described below
commit 60c8d5168e5f7dc5d422d1593ef0d6e214f40a3d
Author: Don Lewis <[email protected]>
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.
(cherry picked from commit 523491489b0a7126864a6de1be3e6e170549602a)
(cherry picked from commit a2201880d8674fe5a1a815270d3a2617a2ef18df)
---
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(