File: fix_mxml.patch

package info (click to toggle)
paulstretch 2.2-2-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 460 kB
  • sloc: cpp: 3,728; ansic: 576; sh: 47; makefile: 18
file content (43 lines) | stat: -rw-r--r-- 1,438 bytes parent folder | download
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
Description: Fix FTBFS
 With mxml v3.0 directly accessing the private node structure is not
 allowed. Instead we need to use the API.

Author: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Bug-Debian: https://bugs.debian.org/952055

---

--- paulstretch-2.2-2.orig/XMLwrapper.cpp
+++ paulstretch-2.2-2/XMLwrapper.cpp
@@ -29,7 +29,11 @@ int xml_k=0;
 char tabs[STACKSIZE+2];
 
 const char *XMLwrapper_whitespace_callback(mxml_node_t *node,int where){
+#ifdef MXML_MAJOR_VERSION
+    const char *name = mxmlGetElement(node);
+#else
     const char *name=node->value.element.name;
+#endif
 
     if ((where==MXML_WS_BEFORE_OPEN)&&(!strcmp(name,"?xml"))) return(NULL);
     if ((where==MXML_WS_BEFORE_CLOSE)&&(!strcmp(name,"string"))) return(NULL);
@@ -406,12 +410,17 @@ void XMLwrapper::getparstr(const char *n
     ZERO(par,maxstrlen);
     node=mxmlFindElement(peek(),peek(),"string","name",name,MXML_DESCEND_FIRST);
     
+#ifdef MXML_MAJOR_VERSION
+    mxml_node_t *temp_node = mxmlGetFirstChild(node);
+    if (temp_node==NULL) return;
+    if (mxmlGetType(temp_node)!=MXML_OPAQUE) return;
+    snprintf(par,maxstrlen,"%s",mxmlGetElement(temp_node));
+#else
     if (node==NULL) return;
     if (node->child==NULL) return;
     if (node->child->type!=MXML_OPAQUE) return;
-    
     snprintf(par,maxstrlen,"%s",node->child->value.element.name);
-    
+#endif
 };
 
 REALTYPE XMLwrapper::getparreal(const char *name,REALTYPE defaultpar){