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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
[PATCH] Fix a compile error
Upstream-Status: Pending
by conditional using 'XML_DOCB_DOCUMENT_NODE' since it is only
defined when LIBXML_DOCB_ENABLED is enabled in xmlversion.h.
Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
LibXML.xs | 9 +-
dom.c | 2 +
perl-libxml-mm.c | 4 +
4 files changed, 678 insertions(+), 658 deletions(-)
diff --git a/LibXML.xs b/LibXML.xs
index b299ba4..66da04b 100644
--- a/LibXML.xs
+++ b/LibXML.xs
@@ -5026,7 +5026,9 @@ addChild( self, nNode )
XSRETURN_UNDEF;
case XML_DOCUMENT_NODE :
case XML_HTML_DOCUMENT_NODE :
+#ifdef LIBXML_DOCB_ENABLED
case XML_DOCB_DOCUMENT_NODE :
+#endif
croak("addChild: HIERARCHY_REQUEST_ERR\n");
XSRETURN_UNDEF;
case XML_NOTATION_NODE :
@@ -5286,7 +5288,9 @@ _toStringC14N(self, comments=0, xpath=&PL_sv_undef, exclusive=0, inc_prefix_list
if ( nodepath == NULL
&& self->type != XML_DOCUMENT_NODE
&& self->type != XML_HTML_DOCUMENT_NODE
+#ifdef LIBXML_DOCB_ENABLED
&& self->type != XML_DOCB_DOCUMENT_NODE
+#endif
) {
if (comments)
nodepath = xmlStrdup( (const xmlChar *) "(. | .//node() | .//@* | .//namespace::*)" );
@@ -5297,7 +5301,10 @@ _toStringC14N(self, comments=0, xpath=&PL_sv_undef, exclusive=0, inc_prefix_list
if ( nodepath != NULL ) {
if ( self->type == XML_DOCUMENT_NODE
|| self->type == XML_HTML_DOCUMENT_NODE
- || self->type == XML_DOCB_DOCUMENT_NODE ) {
+#ifdef LIBXML_DOCB_ENABLED
+ || self->type == XML_DOCB_DOCUMENT_NODE
+#endif
+ ) {
refNode = xmlDocGetRootElement( self->doc );
}
if (SvOK(xpath_context)) {
diff --git a/dom.c b/dom.c
index 87eb61d..cbd391b 100644
--- a/dom.c
+++ b/dom.c
@@ -654,7 +654,9 @@ domName(xmlNodePtr node) {
case XML_DOCUMENT_NODE :
case XML_HTML_DOCUMENT_NODE :
+#ifdef LIBXML_DOCB_ENABLED
case XML_DOCB_DOCUMENT_NODE :
+#endif
name = (const xmlChar *) "#document";
break;
diff --git a/perl-libxml-mm.c b/perl-libxml-mm.c
index d162b06..7ac5436 100644
--- a/perl-libxml-mm.c
+++ b/perl-libxml-mm.c
@@ -331,7 +331,9 @@ PmmNewNode(xmlNodePtr node)
switch ( node->type ) {
case XML_DOCUMENT_NODE:
case XML_HTML_DOCUMENT_NODE:
+#ifdef LIBXML_DOCB_ENABLED
case XML_DOCB_DOCUMENT_NODE:
+#endif
proxy = (ProxyNodePtr)xmlMalloc(sizeof(struct _DocProxyNode));
if (proxy != NULL) {
((DocProxyNodePtr)proxy)->psvi_status = Pmm_NO_PSVI;
@@ -550,7 +552,9 @@ PmmNodeToSv( xmlNodePtr node, ProxyNodePtr owner )
switch ( node->type ) {
case XML_DOCUMENT_NODE:
case XML_HTML_DOCUMENT_NODE:
+#ifdef LIBXML_DOCB_ENABLED
case XML_DOCB_DOCUMENT_NODE:
+#endif
if ( ((xmlDocPtr)node)->encoding != NULL ) {
SetPmmENCODING(dfProxy, (int)xmlParseCharEncoding( (const char*)((xmlDocPtr)node)->encoding ));
}
--
1.7.10.4
|