php: fix build with libxml 2.12

[skip ci]
This commit is contained in:
Chongyun Lee 2023-12-24 20:54:46 +08:00
parent 92dd945354
commit 54925b8247
2 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,42 @@
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);

View File

@ -0,0 +1,14 @@
https://github.com/termux/termux-packages/issues/18803
https://github.com/php/php-src/commit/0a39890c967aa57225bb6bdf4821aff7a3a3c082
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -331,7 +331,7 @@
sdl_restore_uri_credentials(ctx);
if (!wsdl) {
- xmlErrorPtr xmlErrorPtr = xmlGetLastError();
+ const xmlError *xmlErrorPtr = xmlGetLastError();
if (xmlErrorPtr) {
soap_error2(E_ERROR, "Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message);