summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive/libarchive/archive_version_details.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-26 13:53:15 (GMT)
committerBrad King <brad.king@kitware.com>2018-09-26 13:53:15 (GMT)
commit6a4b1006f9561ea126073329216c4815ca731c31 (patch)
treee39ae350a8f4e399a974d3417e6efc06aaece3c3 /Utilities/cmlibarchive/libarchive/archive_version_details.c
parent710f37c47a7df54c39e50d050e790271c547ad80 (diff)
parent2aaed7a05053c3bcbebbff5ae1beb51e590b3ad1 (diff)
downloadCMake-6a4b1006f9561ea126073329216c4815ca731c31.zip
CMake-6a4b1006f9561ea126073329216c4815ca731c31.tar.gz
CMake-6a4b1006f9561ea126073329216c4815ca731c31.tar.bz2
Merge branch 'upstream-LibArchive' into update-libarchive
* upstream-LibArchive: LibArchive 2018-09-03 (5fe69dd0)
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_version_details.c')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_version_details.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_version_details.c b/Utilities/cmlibarchive/libarchive/archive_version_details.c
index 9289bf1..e773e5e 100644
--- a/Utilities/cmlibarchive/libarchive/archive_version_details.c
+++ b/Utilities/cmlibarchive/libarchive/archive_version_details.c
@@ -45,6 +45,9 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_util.c 201098 2009-12-28 02:58:1
#ifdef HAVE_LZ4_H
#include <lz4.h>
#endif
+#ifdef HAVE_ZSTD_H
+#include <zstd.h>
+#endif
#include "archive.h"
#include "archive_private.h"
@@ -59,6 +62,7 @@ archive_version_details(void)
const char *liblzma = archive_liblzma_version();
const char *bzlib = archive_bzlib_version();
const char *liblz4 = archive_liblz4_version();
+ const char *libzstd = archive_libzstd_version();
if (!init) {
archive_string_init(&str);
@@ -84,6 +88,10 @@ archive_version_details(void)
archive_strcat(&str, " liblz4/");
archive_strcat(&str, liblz4);
}
+ if (libzstd) {
+ archive_strcat(&str, " libzstd/");
+ archive_strcat(&str, libzstd);
+ }
}
return str.s;
}
@@ -131,3 +139,13 @@ archive_liblz4_version(void)
return NULL;
#endif
}
+
+const char *
+archive_libzstd_version(void)
+{
+#if HAVE_ZSTD_H && HAVE_LIBZSTD
+ return ZSTD_VERSION_STRING;
+#else
+ return NULL;
+#endif
+}