Files
termux-packages/packages/php/ext-libxml-libxml.c.patch
termux-pacman-bot 0bbc8bafc8 php: fix build with libxml 2.12
[skip ci]
2023-12-24 13:01:28 +00:00

43 lines
1.1 KiB
Diff

https://github.com/termux/termux-packages/issues/18803
https://github.com/php/php-src/commit/0a39890c967aa57225bb6bdf4821aff7a3a3c082
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -472,7 +472,11 @@
xmlResetError((xmlErrorPtr) ptr);
}
+#if LIBXML_VERSION >= 21200
+static void _php_list_set_error_structure(const xmlError *error, const char *msg)
+#else
static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
+#endif
{
xmlError error_copy;
int ret;
@@ -725,7 +729,11 @@
va_end(args);
}
+#if LIBXML_VERSION >= 21200
+PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, const xmlError *error)
+#else
PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
+#endif
{
_php_list_set_error_structure(error, NULL);
@@ -957,11 +965,9 @@
/* {{{ Retrieve last error from libxml */
PHP_FUNCTION(libxml_get_last_error)
{
- xmlErrorPtr error;
-
ZEND_PARSE_PARAMETERS_NONE();
- error = xmlGetLastError();
+ const xmlError *error = xmlGetLastError();
if (error) {
object_init_ex(return_value, libxmlerror_class_entry);