From 1a72f11ca190ecc11de701994da7b5611919be6e Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Sat, 27 Jan 2024 22:51:15 +0200 Subject: [PATCH] Fix support for libxml2-2.12 with its api and header changes Signed-off-by: Alfred Wingate --- library/grt/src/grt.h | 1 + library/grt/src/unserializer.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/library/grt/src/grt.h b/library/grt/src/grt.h index 47bfd637c..34417cf08 100644 --- a/library/grt/src/grt.h +++ b/library/grt/src/grt.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "base/threading.h" #include diff --git a/library/grt/src/unserializer.cpp b/library/grt/src/unserializer.cpp index 6dda76d60..68fb8a11c 100644 --- a/library/grt/src/unserializer.cpp +++ b/library/grt/src/unserializer.cpp @@ -401,7 +401,11 @@ ValueRef internal::Unserializer::unserialize_xmldata(const char *data, size_t si xmlDocPtr doc = xmlReadMemory(data, (int)size, NULL, NULL, XML_PARSE_NOENT); if (!doc) { +#if LIBXML_VERSION >= 21200 + const xmlError* error = xmlGetLastError(); +#else xmlErrorPtr error = xmlGetLastError(); +#endif if (error) throw std::runtime_error(base::strfmt("Could not parse XML data. Line %d, %s", error->line, error->message));