From fc0c89940e80ac52bbc9d3f5cdbb72c94bc25ad2 Mon Sep 17 00:00:00 2001 From: zhangxianting Date: Thu, 11 Apr 2024 02:00:53 +0800 Subject: [PATCH] fix build error :assign const _xmlError * value to _xmlError --- xml2/src/xml2_init.cpp | 2 +- xml2/src/xml2_schema.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xml2/src/xml2_init.cpp b/xml2/src/xml2_init.cpp index b89c64a..0ff2782 100644 --- a/xml2/src/xml2_init.cpp +++ b/xml2/src/xml2_init.cpp @@ -43,7 +43,7 @@ extern "C" SEXP init_libxml2() { LIBXML_TEST_VERSION xmlInitParser(); - xmlSetStructuredErrorFunc(NULL, handleStructuredError); + xmlSetStructuredErrorFunc(NULL, (xmlStructuredErrorFunc)handleStructuredError); xmlSetGenericErrorFunc(NULL, handleGenericError); return R_NilValue; diff --git a/xml2/src/xml2_schema.cpp b/xml2/src/xml2_schema.cpp index dfe37e5..fe6fa9a 100644 --- a/xml2/src/xml2_schema.cpp +++ b/xml2/src/xml2_schema.cpp @@ -6,7 +6,7 @@ #include #include "xml2_utils.h" -void handleSchemaError(void* userData, xmlError* error) { +void handleSchemaError(void* userData, const xmlError* error) { std::vector * vec = (std::vector *) userData; std::string message = std::string(error->message); message.resize(message.size() - 1); -- 2.33.0