Skip to content

Commit 5de53d0

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 73b068a commit 5de53d0

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

@@ -294,7 +300,7 @@ void Parser::callback_error_or_warning(MsgType msg_type, void* ctx,
294300
auto parser = static_cast<Parser*>(context->_private);
295301
if(parser)
296302
{
297-
auto ubuff = format_xml_error(&context->lastError);
303+
auto ubuff = format_xml_error(xmlCtxtGetLastError(context));
298304
if (ubuff.empty())
299305
{
300306
// Usually the result of formatting var_args with the format string msg

0 commit comments

Comments
 (0)