@@ -580,7 +580,11 @@ static void _php_libxml_free_error(void *ptr)
580
580
xmlResetError ((xmlErrorPtr ) ptr );
581
581
}
582
582
583
- static void _php_list_set_error_structure (xmlErrorPtr error , const char * msg , int line , int column )
583
+ #if LIBXML_VERSION >= 21200
584
+ static void _php_list_set_error_structure (const xmlError * error , const char * msg , int line , int column )
585
+ #else
586
+ static void _php_list_set_error_structure (const xmlError * error , const char * msg , int line , int column )
587
+ #endif
584
588
{
585
589
xmlError error_copy ;
586
590
int ret ;
@@ -824,7 +828,10 @@ PHP_LIBXML_API void php_libxml_pretend_ctx_error_ex(const char *file, int line,
824
828
if (!last -> file ) {
825
829
last -> file = strdup (file );
826
830
}
831
+ /* Until there is a replacement */
832
+ ZEND_DIAGNOSTIC_IGNORED_START ("-Wdeprecated-declarations" )
827
833
xmlCopyError (last , & xmlLastError );
834
+ ZEND_DIAGNOSTIC_IGNORED_END
828
835
}
829
836
}
830
837
}
@@ -845,11 +852,13 @@ PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...)
845
852
va_end (args );
846
853
}
847
854
855
+ #if LIBXML_VERSION >= 21200
856
+ static void php_libxml_structured_error_handler (void * userData , const xmlError * error )
857
+ #else
848
858
static void php_libxml_structured_error_handler (void * userData , xmlErrorPtr error )
859
+ #endif
849
860
{
850
861
_php_list_set_error_structure (error , NULL , 0 , 0 );
851
-
852
- return ;
853
862
}
854
863
855
864
PHP_LIBXML_API void php_libxml_error_handler (void * ctx , const char * msg , ...)
@@ -1077,11 +1086,9 @@ PHP_FUNCTION(libxml_use_internal_errors)
1077
1086
/* {{{ Retrieve last error from libxml */
1078
1087
PHP_FUNCTION (libxml_get_last_error )
1079
1088
{
1080
- xmlErrorPtr error ;
1081
-
1082
1089
ZEND_PARSE_PARAMETERS_NONE ();
1083
1090
1084
- error = xmlGetLastError ();
1091
+ const xmlError * error = xmlGetLastError ();
1085
1092
1086
1093
if (error ) {
1087
1094
object_init_ex (return_value , libxmlerror_class_entry );
@@ -1108,7 +1115,6 @@ PHP_FUNCTION(libxml_get_last_error)
1108
1115
/* {{{ Retrieve array of errors */
1109
1116
PHP_FUNCTION (libxml_get_errors )
1110
1117
{
1111
-
1112
1118
xmlErrorPtr error ;
1113
1119
1114
1120
ZEND_PARSE_PARAMETERS_NONE ();
0 commit comments