summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2023-01-22 11:09:58 +0100
committerSlávek Banko <slavek.banko@axis.cz>2023-01-22 11:09:58 +0100
commitd5b88d19a67d76d296f2f68b2b1923791f2ef449 (patch)
treeb3bf82d94b6aad6885e3754098e42847b02eaa2b
parenta28d15e49252a42339b9c5810f0a975979c21830 (diff)
downloadklamav-d5b88d19a67d76d296f2f68b2b1923791f2ef449.tar.gz
klamav-d5b88d19a67d76d296f2f68b2b1923791f2ef449.zip
Add check to see if the libclamav API uses cl_error_t for return codes.r14.1.0
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--ConfigureChecks.cmake4
-rw-r--r--config.h.cmake5
-rw-r--r--src/dbviewer.cpp4
3 files changed, 10 insertions, 3 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 8e29910..47f2fca 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -41,6 +41,10 @@ if( NOT LIBCLAMAV_FOUND )
tde_message_fatal( "ClamAV >=0.102.0 is required but not found on your system" )
endif( NOT LIBCLAMAV_FOUND )
+if( NOT "${LIBCLAMAV_VERSION}" VERSION_LESS "0.103" )
+ set( USE_CL_ERROR_T 1 )
+endif()
+
##### check for zlib (needed by Virus Browser)
diff --git a/config.h.cmake b/config.h.cmake
index 67860c5..d6cfd68 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -7,6 +7,5 @@
significant byte first (like Motorola and SPARC, unlike Intel). */
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
-/* Defined if you don't have either the XTest headers or
- the xcb-util-keysyms headers */
-#cmakedefine NO_XTEST_EXTENSION 1
+/* Defined if libclamav API uses cl_error_t for return codes */
+#cmakedefine USE_CL_ERROR_T 1
diff --git a/src/dbviewer.cpp b/src/dbviewer.cpp
index 7d5e200..c085ddd 100644
--- a/src/dbviewer.cpp
+++ b/src/dbviewer.cpp
@@ -839,7 +839,11 @@ void KlamDB::addVirusName(char *start)
unsigned int KlamDB::getSigNos()
{
+# if defined(USE_CL_ERROR_T)
cl_error_t ret = CL_CLEAN;
+# else
+ unsigned int ret= 0;
+# endif
unsigned int no = 0;
struct cl_engine *engine = NULL;
TQStringList lastDownloadPaths;