Skip to content

Commit f95608c

Browse files
committed
Parser: Ignore deprecation of xmlParserCtxt members
* parsers/parser.cc: Direct access to xmlParserCtxt::options, linenumbers and lastError is deprecated since libxml2 2.14.0. Ignore deprecations. Use xmlCtxtGetLastError().
1 parent d1b1c4e commit f95608c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libxml++/parsers/parser.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
* included with libxml++ as the file COPYING.
55
*/
66

7+
// Direct access to xmlParserCtxt::options and xmlParserCtxt::linenumbers
8+
// is deprecated since libxml2 2.14.0.
9+
// xmlCtxtGetOptions() is new in libxml2 2.14.0.
10+
// Ignore deprecations here.
11+
#define XML_DEPRECATED_MEMBER
12+
713
#include "libxml++/exceptions/wrapped_exception.h"
814
#include "libxml++/parsers/parser.h"
915

@@ -280,7 +286,7 @@ void Parser::callback_error_or_warning(MsgType msg_type, void* ctx,
280286
auto parser = static_cast<Parser*>(context->_private);
281287
if(parser)
282288
{
283-
auto ubuff = format_xml_error(&context->lastError);
289+
auto ubuff = format_xml_error(xmlCtxtGetLastError(context));
284290
if (ubuff.empty())
285291
{
286292
// Usually the result of formatting var_args with the format string msg

0 commit comments

Comments
 (0)