Skip to content

Commit 0a39890

Browse files
committed
1 parent 4eee81b commit 0a39890

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
@@ -472,7 +472,11 @@ static void _php_libxml_free_error(void *ptr)
472472
xmlResetError((xmlErrorPtr) ptr);
473473
}
474474

475-
static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
475+
#if LIBXML_VERSION >= 21200
476+
static void _php_list_set_error_structure(const xmlError *error, const char *msg)
477+
#else
478+
static void _php_list_set_error_structure(xmlError *error, const char *msg)
479+
#endif
476480
{
477481
xmlError error_copy;
478482
int ret;
@@ -725,7 +729,11 @@ PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...)
725729
va_end(args);
726730
}
727731

732+
#if LIBXML_VERSION >= 21200
733+
PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, const xmlError *error)
734+
#else
728735
PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
736+
#endif
729737
{
730738
_php_list_set_error_structure(error, NULL);
731739

@@ -957,11 +965,9 @@ PHP_FUNCTION(libxml_use_internal_errors)
957965
/* {{{ Retrieve last error from libxml */
958966
PHP_FUNCTION(libxml_get_last_error)
959967
{
960-
xmlErrorPtr error;
961-
962968
ZEND_PARSE_PARAMETERS_NONE();
963969

964-
error = xmlGetLastError();
970+
const xmlError *error = xmlGetLastError();
965971

966972
if (error) {
967973
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)