Skip to content

Commit 087e974

Browse files
nielsdosremicollet
authored andcommitted
Backport 0a39890c: Fix libxml2 2.12 build due to API breaks
See https://github.com/php/php-src/actions/runs/7062192818/job/19225478601 (cherry picked from commit fa6a0f80f644932506666beb7c85e4041c4a4646) (cherry picked from commit 6e8e9f5)
1 parent 8a2195d commit 087e974

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
@@ -530,7 +530,11 @@ static int _php_libxml_free_error(xmlErrorPtr error)
530530
return 1;
531531
}
532532

533-
static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
533+
#if LIBXML_VERSION >= 21200
534+
static void _php_list_set_error_structure(const xmlError *error, const char *msg)
535+
#else
536+
static void _php_list_set_error_structure(xmlError *error, const char *msg)
537+
#endif
534538
{
535539
xmlError error_copy;
536540
int ret;
@@ -784,7 +788,11 @@ PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...)
784788
va_end(args);
785789
}
786790

791+
#if LIBXML_VERSION >= 21200
792+
PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, const xmlError *error)
793+
#else
787794
PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
795+
#endif
788796
{
789797
_php_list_set_error_structure(error, NULL);
790798

@@ -1063,9 +1071,7 @@ static PHP_FUNCTION(libxml_use_internal_errors)
10631071
Retrieve last error from libxml */
10641072
static PHP_FUNCTION(libxml_get_last_error)
10651073
{
1066-
xmlErrorPtr error;
1067-
1068-
error = xmlGetLastError();
1074+
const xmlError *error = xmlGetLastError();
10691075

10701076
if (error) {
10711077
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
@@ -333,7 +333,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include)
333333
sdl_restore_uri_credentials(ctx);
334334

335335
if (!wsdl) {
336-
xmlErrorPtr xmlErrorPtr = xmlGetLastError();
336+
const xmlError *xmlErrorPtr = xmlGetLastError();
337337

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

0 commit comments

Comments
 (0)