From b727a394d19f79363af296d5ff773cda36a2056e Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Thu, 5 Jun 2025 16:51:38 +0000 Subject: fix missing __xmlParserVersion() compat in newer libxml2, spotted by bakai libxml2 deprecated __xmlParserVersion() and added a pointer to constant string version in commit 2023-09-20 "globals: Don't store xmlParserVersion in global state" and added a compat function with it. This commit was made before v2.12.0 was released. Thus, any version *past* unreleased v2.12.0 is guaranteed to have the new API. The compat function was removed at some point later, causing a compile failure. **** mana/plus!190 --- src/unittests/utils/dumplibs.cc | 7 ++++++- src/utils/dumplibs.cpp | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/unittests/utils/dumplibs.cc b/src/unittests/utils/dumplibs.cc index 594c90501..f23b2b7ec 100644 --- a/src/unittests/utils/dumplibs.cc +++ b/src/unittests/utils/dumplibs.cc @@ -57,7 +57,12 @@ TEST_CASE("dumplibs tests", "") #ifdef ENABLE_LIBXML SECTION("libxml2") { - const char *const *xmlVersion = __xmlParserVersion(); + const char *const *xmlVersion +#if LIBXML_VERSION > 21200 + = &xmlParserVersion; +#else + = __xmlParserVersion(); +#endif REQUIRE(xmlVersion != nullptr); REQUIRE(*xmlVersion != nullptr); REQUIRE(std::string(*xmlVersion) == diff --git a/src/utils/dumplibs.cpp b/src/utils/dumplibs.cpp index 66fe62798..7efa3704a 100644 --- a/src/utils/dumplibs.cpp +++ b/src/utils/dumplibs.cpp @@ -140,7 +140,13 @@ void dumpLibs() LIBXML_TEST_VERSION #endif // LIBXML_TEST_VERSION #ifdef ENABLE_LIBXML - const char *const *xmlVersion = __xmlParserVersion(); + const char *const *xmlVersion +#if LIBXML_VERSION > 21200 + = &xmlParserVersion; +#else + = __xmlParserVersion(); +#endif + if (xmlVersion != nullptr) logger->log(" libxml2: %s", *xmlVersion); #endif // ENABLE_LIBXML -- cgit v1.2.3-70-g09d2