blob: d255ec75330b3d7220db7b87f4ff36ea203b7e00 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001[PATCH] Fix a compile error
2
3Upstream-Status: Pending
4
5by conditional using 'XML_DOCB_DOCUMENT_NODE' since it is only
6defined when LIBXML_DOCB_ENABLED is enabled in xmlversion.h.
7
8Signed-off-by: Roy Li <rongqing.li@windriver.com>
9---
10 LibXML.xs | 9 +-
11 dom.c | 2 +
12 perl-libxml-mm.c | 4 +
13 4 files changed, 678 insertions(+), 658 deletions(-)
14
15diff --git a/LibXML.xs b/LibXML.xs
16index b299ba4..66da04b 100644
17--- a/LibXML.xs
18+++ b/LibXML.xs
19@@ -5026,7 +5026,9 @@ addChild( self, nNode )
20 XSRETURN_UNDEF;
21 case XML_DOCUMENT_NODE :
22 case XML_HTML_DOCUMENT_NODE :
23+#ifdef LIBXML_DOCB_ENABLED
24 case XML_DOCB_DOCUMENT_NODE :
25+#endif
26 croak("addChild: HIERARCHY_REQUEST_ERR\n");
27 XSRETURN_UNDEF;
28 case XML_NOTATION_NODE :
29@@ -5286,7 +5288,9 @@ _toStringC14N(self, comments=0, xpath=&PL_sv_undef, exclusive=0, inc_prefix_list
30 if ( nodepath == NULL
31 && self->type != XML_DOCUMENT_NODE
32 && self->type != XML_HTML_DOCUMENT_NODE
33+#ifdef LIBXML_DOCB_ENABLED
34 && self->type != XML_DOCB_DOCUMENT_NODE
35+#endif
36 ) {
37 if (comments)
38 nodepath = xmlStrdup( (const xmlChar *) "(. | .//node() | .//@* | .//namespace::*)" );
39@@ -5297,7 +5301,10 @@ _toStringC14N(self, comments=0, xpath=&PL_sv_undef, exclusive=0, inc_prefix_list
40 if ( nodepath != NULL ) {
41 if ( self->type == XML_DOCUMENT_NODE
42 || self->type == XML_HTML_DOCUMENT_NODE
43- || self->type == XML_DOCB_DOCUMENT_NODE ) {
44+#ifdef LIBXML_DOCB_ENABLED
45+ || self->type == XML_DOCB_DOCUMENT_NODE
46+#endif
47+ ) {
48 refNode = xmlDocGetRootElement( self->doc );
49 }
50 if (SvOK(xpath_context)) {
51diff --git a/dom.c b/dom.c
52index 87eb61d..cbd391b 100644
53--- a/dom.c
54+++ b/dom.c
55@@ -654,7 +654,9 @@ domName(xmlNodePtr node) {
56
57 case XML_DOCUMENT_NODE :
58 case XML_HTML_DOCUMENT_NODE :
59+#ifdef LIBXML_DOCB_ENABLED
60 case XML_DOCB_DOCUMENT_NODE :
61+#endif
62 name = (const xmlChar *) "#document";
63 break;
64
65diff --git a/perl-libxml-mm.c b/perl-libxml-mm.c
66index d162b06..7ac5436 100644
67--- a/perl-libxml-mm.c
68+++ b/perl-libxml-mm.c
69@@ -331,7 +331,9 @@ PmmNewNode(xmlNodePtr node)
70 switch ( node->type ) {
71 case XML_DOCUMENT_NODE:
72 case XML_HTML_DOCUMENT_NODE:
73+#ifdef LIBXML_DOCB_ENABLED
74 case XML_DOCB_DOCUMENT_NODE:
75+#endif
76 proxy = (ProxyNodePtr)xmlMalloc(sizeof(struct _DocProxyNode));
77 if (proxy != NULL) {
78 ((DocProxyNodePtr)proxy)->psvi_status = Pmm_NO_PSVI;
79@@ -550,7 +552,9 @@ PmmNodeToSv( xmlNodePtr node, ProxyNodePtr owner )
80 switch ( node->type ) {
81 case XML_DOCUMENT_NODE:
82 case XML_HTML_DOCUMENT_NODE:
83+#ifdef LIBXML_DOCB_ENABLED
84 case XML_DOCB_DOCUMENT_NODE:
85+#endif
86 if ( ((xmlDocPtr)node)->encoding != NULL ) {
87 SetPmmENCODING(dfProxy, (int)xmlParseCharEncoding( (const char*)((xmlDocPtr)node)->encoding ));
88 }
89--
901.7.10.4
91