On Wed, Aug 08, 2012 at 02:08:01AM +0200, Richard Taubo wrote:
> Hi!
>
> For testing I have been installing the following libxml libraries:
> - libxml2-2.7.8
> - libxml2-2.8.0
> - libxml2-2.9.0
First thing libxml2-2.9.0 is not available, I just ade an rc0 snapshot
it's not a supported release :-)
> These have been installed separately using:
> [#] ./configure --prefix=/usr/local/LIBXML2
> [#] make
> [#] make install
>
> When installing php 5.4.5 from source, I don't have any problems
> compiling php 5.4.5 as long as I use either libxml2-2.7.8 or libxml2-2.8.0
> BUT when i compile php 5.4.5. with libxml2-2.9.0, I get an error and PHP
> 5.4.5 won't
> compile.
>
> PHP 5.4.5 is compiled like this:
> [#] ./configure --prefix=/usr/local/php --with-libxml-dir=/usr/local/LIBXML2
> (for clarity skipping other libraries that I also use).
>
> [#] make
>
> Then I get the following error message before the make command exits:
> /usr/local/src/php_sources/php-5.4.5/ext/dom/node.c: In function
> ‘dom_canonicalization’:
> /usr/local/src/php_sources/php-5.4.5/ext/dom/node.c:1898: error:
> dereferencing pointer to incomplete type
> /usr/local/src/php_sources/php-5.4.5/ext/dom/node.c:1900: error:
> dereferencing pointer to incomplete type
> make: *** [ext/dom/node.lo] Error 1
>
> When the version in /usr/local/LIBXML2 is either libxml2-2.7.8 or
> libxml2-2.8.0
> I don't get this error.
The attached patch fixes your problem,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
[email protected] | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
--- ext/dom/node.c 2012-08-06 17:49:48.826716692 +0800
+++ ext/dom/node.c 2012-08-06 17:52:47.633484660 +0800
@@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNA
RETVAL_FALSE;
} else {
if (mode == 0) {
+#ifdef LIBXML2_NEW_BUFFER
+ ret = xmlOutputBufferGetSize(buf);
+#else
ret = buf->buffer->use;
+#endif
if (ret > 0) {
+#ifdef LIBXML2_NEW_BUFFER
+ RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret,
1);
+#else
RETVAL_STRINGL((char *) buf->buffer->content,
ret, 1);
+#endif
} else {
RETVAL_EMPTY_STRING();
}
--- ext/dom/documenttype.c 2012-08-06 18:02:16.019640870 +0800
+++ ext/dom/documenttype.c 2012-08-06 18:06:16.612228905 +0800
@@ -205,7 +205,13 @@ int dom_documenttype_internal_subset_rea
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset,
0, 0, NULL);
xmlOutputBufferFlush(buff);
+
+#ifdef LIBXML2_NEW_BUFFER
+ ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff),
+ xmlOutputBufferGetSize(buff), 1);
+#else
ZVAL_STRINGL(*retval, buff->buffer->content,
buff->buffer->use, 1);
+#endif
(void)xmlOutputBufferClose(buff);
return SUCCESS;
}
--- ext/simplexml/simplexml.c 2012-08-06 18:10:44.621017026 +0800
+++ ext/simplexml/simplexml.c 2012-08-06 18:12:48.016270419 +0800
@@ -1417,7 +1417,12 @@ SXE_METHOD(asXML)
xmlNodeDumpOutput(outbuf, (xmlDocPtr)
sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding);
xmlOutputBufferFlush(outbuf);
+#ifdef LIBXML2_NEW_BUFFER
+ RETVAL_STRINGL((char
*)xmlOutputBufferGetContent(outbuf),
+ xmlOutputBufferGetSize(outbuf), 1);
+#else
RETVAL_STRINGL((char *)outbuf->buffer->content,
outbuf->buffer->use, 1);
+#endif
xmlOutputBufferClose(outbuf);
}
} else {
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml