Fix failure to build with libxml2 version 2.12

This declared some xmlError pointers const, which probably was always
assumed, but not made explicit.

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
This commit is contained in:
Nils Philippsen 2023-11-17 23:26:06 +01:00
parent 253dcb312b
commit e995daa375
2 changed files with 7 additions and 3 deletions

View File

@ -255,7 +255,7 @@ libxml_generic_error_func (void* /* parsing_context*/,
static void
libxml_structured_error_func (void* /* parsing_context*/,
xmlErrorPtr err)
const xmlError *err)
{
string msg;
@ -403,7 +403,11 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
/* stop libxml from spewing to stdout/stderr */
xmlSetGenericErrorFunc (this, libxml_generic_error_func);
xmlSetStructuredErrorFunc (this, libxml_structured_error_func);
/* Cast to xmlStructuredErrorFunc to cope with different constness in different
* versions of libxml2. */
xmlSetStructuredErrorFunc (this, (xmlStructuredErrorFunc)libxml_structured_error_func);
/* Set this up early */

View File

@ -170,7 +170,7 @@ XMLTree::write() const
result = xmlSaveFormatFileEnc(_filename.c_str(), doc, "UTF-8", 1);
#ifndef NDEBUG
if (result == -1) {
xmlErrorPtr xerr = xmlGetLastError ();
const xmlError *xerr = xmlGetLastError ();
if (!xerr) {
std::cerr << "unknown XML error during xmlSaveFormatFileEnc()." << std::endl;
} else {