diff --git a/hphp/runtime/ext/libxml/ext_libxml.cpp b/hphp/runtime/ext/libxml/ext_libxml.cpp index d980e20a2eba29..22c79e923d857b 100644 --- a/hphp/runtime/ext/libxml/ext_libxml.cpp +++ b/hphp/runtime/ext/libxml/ext_libxml.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef LIBXML_SCHEMAS_ENABLED #include #include @@ -624,7 +625,11 @@ String libxml_get_valid_file_path(const String& source) { return file_dest; } +#if LIBXML_VERSION >= 21200 +static void libxml_error_handler(void* /*userData*/, const xmlError* error) { +#else static void libxml_error_handler(void* /*userData*/, xmlErrorPtr error) { +#endif if (rl_libxml_request_data->m_suppress_error) { return; } @@ -642,7 +647,7 @@ static void libxml_error_handler(void* /*userData*/, xmlErrorPtr error) { } } -static Object create_libxmlerror(xmlError &error) { +static Object create_libxmlerror(const xmlError &error) { Object ret{ LibXMLError::classof() }; // Setting only public properties ret->setProp(nullctx, s_level.get(), make_tv(error.level)); @@ -678,7 +683,7 @@ Array HHVM_FUNCTION(libxml_get_errors) { } Variant HHVM_FUNCTION(libxml_get_last_error) { - xmlErrorPtr error = xmlGetLastError(); + auto error = xmlGetLastError(); if (error) { return create_libxmlerror(*error); } diff --git a/hphp/runtime/ext/soap/sdl.cpp b/hphp/runtime/ext/soap/sdl.cpp index 2106a12a02c340..741a1656d4b512 100644 --- a/hphp/runtime/ext/soap/sdl.cpp +++ b/hphp/runtime/ext/soap/sdl.cpp @@ -178,7 +178,7 @@ static void load_wsdl_ex(char *struri, sdlCtx *ctx, bool include, wsdl = soap_xmlParseFile(struri); } if (!wsdl) { - xmlErrorPtr xmlErrorPtr = xmlGetLastError(); + auto xmlErrorPtr = xmlGetLastError(); if (xmlErrorPtr) { throw SoapException("Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message);