File: libxml2-2.14.5.patch

package info (click to toggle)
scilab 2024.1.0%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 381,880 kB
  • sloc: xml: 765,066; ansic: 285,813; cpp: 264,881; java: 172,629; fortran: 91,526; ml: 23,103; tcl: 16,853; makefile: 9,722; sh: 7,027; f90: 6,437; lex: 1,656; perl: 1,566; yacc: 1,308; php: 690; cs: 613; javascript: 50
file content (74 lines) | stat: -rw-r--r-- 2,366 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Description: conforming to changes in libxml2/2.14.5
 Some symbols have changed their location, adding includes to find them.
 Also xmlSetStructuredErrorFunc in /usr/include/libxml2/libxml/xmlerror.h now
 expects a second argument with const qualifier: changing
 XMLDocument::errorXPathFunction accordingly.
 The package should be upstreamed.
Author: Pierre Gruet <pgt@debian.org>
Forwarded: https://gitlab.com/scilab/scilab/-/issues/17262
Last-Update: 2025-08-18

--- a/scilab/modules/preferences/src/c/getScilabPreference.c
+++ b/scilab/modules/preferences/src/c/getScilabPreference.c
@@ -17,6 +17,7 @@
 #include <stdlib.h>
 #include <libxml/xpath.h>
 #include <libxml/xmlreader.h>
+#include <libxml/xmlsave.h>
 #include "getScilabPreference.h"
 #include "GetXmlFileEncoding.h"
 #include "sci_malloc.h"
--- a/scilab/modules/xml/src/cpp/XMLDocument.cpp
+++ b/scilab/modules/xml/src/cpp/XMLDocument.cpp
@@ -20,6 +20,7 @@
 #include "XMLValidation.hxx"
 #include "XMLValidationRelaxNG.hxx"
 #include "VariableScope.hxx"
+#include <libxml/xmlsave.h>
 
 extern "C"
 {
@@ -520,7 +521,7 @@
     errorBuffer.append(str);
 }
 
-void XMLDocument::errorXPathFunction(void *ctx, xmlError * error)
+void XMLDocument::errorXPathFunction(void *ctx, const xmlError * error)
 {
     errorXPathBuffer.append(error->message);
 }
--- a/scilab/modules/xml/src/cpp/XMLDocument.hxx
+++ b/scilab/modules/xml/src/cpp/XMLDocument.hxx
@@ -20,6 +20,7 @@
 #include <list>
 #include <cstring>
 #include <string>
+#include <libxml/xmlerror.h>
 
 #include "dynlib_xml_scilab.h"
 
@@ -172,7 +173,7 @@
      * Error function used when the XPath query is compiled/
      * @see http://xmlsoft.org/html/libxml-xmlerror.html#xmlStructuredErrorFunc
      */
-    static void errorXPathFunction(void *ctx, xmlError * error);
+    static void errorXPathFunction(void *ctx, const xmlError * error);
 
     /**
      * Reads and parses a document given in a file.
--- a/scilab/modules/scicos/src/cpp/XMIResource_load.cpp
+++ b/scilab/modules/scicos/src/cpp/XMIResource_load.cpp
@@ -55,11 +55,11 @@
     LibXML2State()
     {
         xmlGenericErrorFunc f = &console_print;
-        initGenericErrorDefaultFunc(&f);
+        xmlSetGenericErrorFunc(nullptr, f);
     }
     ~LibXML2State()
     {
-        initGenericErrorDefaultFunc(nullptr);
+        xmlSetGenericErrorFunc(nullptr, nullptr);
     }
 };