Skip to content

Commit 728e76f

Browse files
committed
Backport 0a39890: Fix libxml2 2.12 build due to API breaks
See https://github.com/php/php-src/actions/runs/7062192818/job/19225478601
1 parent 8497400 commit 728e76f

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

ext/libxml/libxml.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,11 @@ static void _php_libxml_free_error(void *ptr)
483483
xmlResetError((xmlErrorPtr) ptr);
484484
}
485485

486-
static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
486+
#if LIBXML_VERSION >= 21200
487+
static void _php_list_set_error_structure(const xmlError *error, const char *msg)
488+
#else
489+
static void _php_list_set_error_structure(xmlError *error, const char *msg)
490+
#endif
487491
{
488492
xmlError error_copy;
489493
int ret;
@@ -736,7 +740,11 @@ PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...)
736740
va_end(args);
737741
}
738742

743+
#if LIBXML_VERSION >= 21200
744+
PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, const xmlError *error)
745+
#else
739746
PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
747+
#endif
740748
{
741749
_php_list_set_error_structure(error, NULL);
742750

@@ -1009,11 +1017,9 @@ PHP_FUNCTION(libxml_use_internal_errors)
10091017
/* {{{ Retrieve last error from libxml */
10101018
PHP_FUNCTION(libxml_get_last_error)
10111019
{
1012-
xmlErrorPtr error;
1013-
10141020
ZEND_PARSE_PARAMETERS_NONE();
10151021

1016-
error = xmlGetLastError();
1022+
const xmlError *error = xmlGetLastError();
10171023

10181024
if (error) {
10191025
object_init_ex(return_value, libxmlerror_class_entry);

ext/soap/php_sdl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include)
332332
sdl_restore_uri_credentials(ctx);
333333

334334
if (!wsdl) {
335-
xmlErrorPtr xmlErrorPtr = xmlGetLastError();
335+
const xmlError *xmlErrorPtr = xmlGetLastError();
336336

337337
if (xmlErrorPtr) {
338338
soap_error2(E_ERROR, "Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message);

0 commit comments

Comments
 (0)