Skip to content

Commit bc072b6

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 591f701 commit bc072b6

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

@@ -361,7 +367,7 @@ void Parser::callback_error_or_warning(bool is_parser, bool is_error, void* ctx,
361367
auto parser = static_cast<Parser*>(context->_private);
362368
if(parser)
363369
{
364-
auto ubuff = format_xml_error(&context->lastError);
370+
auto ubuff = format_xml_error(xmlCtxtGetLastError(context));
365371
if (ubuff.empty())
366372
{
367373
// Usually the result of formatting var_args with the format string msg

0 commit comments

Comments
 (0)