]> gitweb.hhaalo.de Git - feierabend.git/commitdiff
change libxml backword compatibility defines
authorBastian Dehn <hhaalo@arcor.de>
Fri, 24 Apr 2026 15:39:16 +0000 (17:39 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 24 Apr 2026 15:39:16 +0000 (17:39 +0200)
src/CMakeLists.txt
src/xml.c

index a8c7049a307889e4ce736352303c1cf9834743e8..12bf112b03ed180fbb4685ba6f5e09b5587e705e 100644 (file)
@@ -7,9 +7,9 @@ include(GNUInstallDirs)
 find_package(LibXml2 REQUIRED)
 message(STATUS "find LibXml2: " ${LIBXML2_LIBRARY})
 
-if(${LIBXML2_VERSION_STRING} VERSION_GREATER_EQUAL 2.10)
-       message(STATUS "define LIBXML2_10")
-       add_compile_definitions(LIBXML2_10)
+if(${LIBXML2_VERSION_STRING} VERSION_LESS 2.10)
+       message(STATUS "define LIBXML_BEFORE_2_10")
+       add_compile_definitions(LIBXML_BEFORE_2_10)
 endif()
 
 message(STATUS "CMAKE_INSTALL_PREFIX " ${CMAKE_INSTALL_PREFIX})
index 20af6c5caedc52b8267fe292c19a743d8067ca31..46fc1649e57d156f77b5734109ffa8931f42aa73 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -295,11 +295,11 @@ void init_time_acount(const uint8_t hour, const uint8_t min)
        xmlFreeTextWriter(xmlWriter);
        xmlWriter = NULL;
 
-#ifdef LIBXML2_10
-       xmlCleanupParser();
-#else
+#ifdef LIBXML_BEFORE_2_10
        xmlDictCleanup();
        xmlCleanupCharEncodingHandlers();
+#else
+       xmlCleanupParser();
 #endif
 
        free(xmlElemContent);
@@ -356,11 +356,11 @@ void add_entry(const char* date,
        xmlFreeTextReader(xmlreader);
        xmlreader = NULL;
 
-#ifdef LIBXML2_10
-       xmlCleanupParser();
-#else
+#ifdef LIBXML_BEFORE_2_10
        xmlCleanupCharEncodingHandlers();
        xmlDictCleanup();
+#else
+       xmlCleanupParser();
 #endif
 
        _free_mem(file_content);
@@ -425,11 +425,11 @@ void merge(const char* dir)
 
        xmlFreeTextWriter(xmlwriter);
        xmlwriter = NULL;
-#ifdef LIBXML2_10
-       xmlCleanupParser();
-#else
+#ifdef LIBXML_BEFORE_2_10
        xmlCleanupCharEncodingHandlers();
        xmlDictCleanup();
+#else
+       xmlCleanupParser();
 #endif
 
        free(xmlElemContent);