Skip to content

Commit df89409

Browse files
committed
Fix compile error with -Werror=incompatible-function-pointer-types and old libxml2
libxml2 prior to 2.9.8 had a different signature for xmlHashScanner. This signature changed in GNOME/libxml2@e03f0a1 Use an #if to work around the incompatible signature. Closes GH-12326.
1 parent fa2d556 commit df89409

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ PHP NEWS
1313
- DOM:
1414
. Restore old namespace reconciliation behaviour. (nielsdos)
1515

16+
- LibXML:
17+
. Fix compile error with -Werror=incompatible-function-pointer-types and
18+
old libxml2. (nielsdos)
19+
1620
- MySQLnd:
1721
. Fixed bug GH-12297 (PHP Startup: Invalid library (maybe not a PHP library)
1822
'mysqlnd.so' in Unknown on line). (nielsdos)

ext/dom/dom_iterators.c

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct _notationIterator {
3838
xmlNotation *notation;
3939
};
4040

41+
/* Function pointer typedef changed in 2.9.8, see https://github.com/GNOME/libxml2/commit/e03f0a199a67017b2f8052354cf732b2b4cae787 */
4142
#if LIBXML_VERSION >= 20908
4243
static void itemHashScanner (void *payload, void *data, const xmlChar *name) /* {{{ */
4344
#else

ext/libxml/libxml.c

+5
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,12 @@ PHP_LIBXML_API void php_libxml_set_old_ns(xmlDocPtr doc, xmlNsPtr ns)
136136
php_libxml_set_old_ns_list(doc, ns, ns);
137137
}
138138

139+
/* Function pointer typedef changed in 2.9.8, see https://github.com/GNOME/libxml2/commit/e03f0a199a67017b2f8052354cf732b2b4cae787 */
140+
#if LIBXML_VERSION >= 20908
139141
static void php_libxml_unlink_entity(void *data, void *table, const xmlChar *name)
142+
#else
143+
static void php_libxml_unlink_entity(void *data, void *table, xmlChar *name)
144+
#endif
140145
{
141146
xmlEntityPtr entity = data;
142147
if (entity->_private != NULL) {

0 commit comments

Comments
 (0)