Skip to content

Commit 36f05a8

Browse files
committed
Fixed build
1 parent c49f0fd commit 36f05a8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ext/dom/document.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,7 +2188,11 @@ PHP_FUNCTION(dom_document_save_html)
21882188

21892189
for (node = node->children; node; node = node->next) {
21902190
htmlNodeDumpFormatOutput(outBuf, docp, node, NULL, format);
2191+
#ifdef LIBXML2_NEW_BUFFER
21912192
one_size = !outBuf->error ? xmlOutputBufferGetSize(outBuf) : -1;
2193+
#else
2194+
one_size = !outBuf->error ? outBuf->buffer->use : -1;
2195+
#endif
21922196
if (one_size >= 0) {
21932197
size = one_size;
21942198
} else {
@@ -2198,10 +2202,18 @@ PHP_FUNCTION(dom_document_save_html)
21982202
}
21992203
} else {
22002204
htmlNodeDumpFormatOutput(outBuf, docp, node, NULL, format);
2205+
#ifdef LIBXML2_NEW_BUFFER
22012206
size = !outBuf->error ? xmlOutputBufferGetSize(outBuf): -1;
2207+
#else
2208+
size = !outBuf->error ? outBuf->buffer->use : -1;
2209+
#endif
22022210
}
22032211
if (size >= 0) {
2212+
#ifdef LIBXML2_NEW_BUFFER
22042213
mem = (xmlChar*) xmlOutputBufferGetContent(outBuf);
2214+
#else
2215+
mem = (xmlChar*) outBuf->buffer->content;
2216+
#endif
22052217
if (!mem) {
22062218
RETVAL_FALSE;
22072219
} else {

0 commit comments

Comments
 (0)