File libxml-2.12-xmlCtxtGetLastError-const.patch of Package nodejs-electron

In version 2.12 of libxml2 a function changed its signature in a non-ABI-breaking way:
https://github.com/GNOME/libxml2/commit/61034116d0a3c8b295c6137956adc3ae55720711

Make code compatible with both signatures

--- src/third_party/blink/renderer/core/xml/xslt_processor.h.orig	2024-04-02 09:53:19.064289800 +0000
+++ src/third_party/blink/renderer/core/xml/xslt_processor.h	2024-04-06 17:07:37.951981800 +0000
@@ -77,6 +77,7 @@ class XSLTProcessor final : public Scrip
 
   void reset();
 
+  static void ParseErrorFunc(void* user_data, xmlError*);
   static void ParseErrorFunc(void* user_data, const xmlError*);
   static void GenericErrorFunc(void* user_data, const char* msg, ...);
 
--- src/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc.orig	2024-04-02 09:53:19.064289800 +0000
+++ src/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc	2024-04-06 17:06:56.822190000 +0000
@@ -92,6 +92,10 @@ void XSLTProcessor::ParseErrorFunc(void*
                                        nullptr)));
 }
 
+void XSLTProcessor::ParseErrorFunc(void* user_data, xmlError *error) {
+  return ParseErrorFunc(user_data, const_cast<xmlError const *>(error));
+}
+
 // FIXME: There seems to be no way to control the ctxt pointer for loading here,
 // thus we have globals.
 static XSLTProcessor* g_global_processor = nullptr;
openSUSE Build Service is sponsored by