From b52a9567520570bd6c850bcad3a6966f68639ef7 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 17 Sep 2020 13:09:06 +0200 Subject: Add a check whether libzstd supports stream compression Streaming compression was added fairly recently to zstd (and then the API was changed a few times). Rather than rely on libzstd versioning macros, this commit adds an m4 script to test at configure time if the enums/functions we need are available by trying to compile a small sample. Signed-off-by: David Oberhollenzer --- lib/fstream/uncompress/zstd.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/fstream/uncompress/zstd.c') diff --git a/lib/fstream/uncompress/zstd.c b/lib/fstream/uncompress/zstd.c index 1838af5..fd22cbf 100644 --- a/lib/fstream/uncompress/zstd.c +++ b/lib/fstream/uncompress/zstd.c @@ -8,6 +8,7 @@ #include +#ifdef HAVE_ZSTD_STREAM typedef struct { istream_comp_t base; @@ -77,3 +78,4 @@ istream_comp_t *istream_zstd_create(const char *filename) base->cleanup = cleanup; return base; } +#endif /* HAVE_ZSTD_STREAM */ -- cgit v1.2.3