Skip to content

Commit

Permalink
Fix minimum libzstd version that supports ZSTD_STREAMING (facebook#9841)
Browse files Browse the repository at this point in the history
Summary:
The minimum libzstd version that has `ZSTD_compressStream2` is
1.4.0 so only define ZSTD_STREAMING in that case.

Fixes building on Ubuntu 18.04 which has libzstd 1.3.3 as its
repository version.

Fixes facebook#9795

Pull Request resolved: facebook#9841

Test Plan:
Build and test on Ubuntu 18.04 with:
  apt-get install libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev \
    libzstd-dev libgflags-dev g++ make curl

Reviewed By: ajkr

Differential Revision: D35648738

Pulled By: jay-zhuang

fbshipit-source-id: 2a9e969bcc17a7dc10172f3817283409de885811
  • Loading branch information
jonathan-albrecht-ibm authored and facebook-github-bot committed Apr 14, 2022
1 parent d6e016b commit 844a351
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions util/compression.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@
#include <zstd.h>
#if ZSTD_VERSION_NUMBER >= 10103 // v1.1.3+
#include <zdict.h>
#define ZSTD_STREAMING
#endif // ZSTD_VERSION_NUMBER >= 10103
#if ZSTD_VERSION_NUMBER >= 10400 // v1.4.0+
#define ZSTD_STREAMING
#endif // ZSTD_VERSION_NUMBER >= 10400
namespace ROCKSDB_NAMESPACE {
// Need this for the context allocation override
// On windows we need to do this explicitly
Expand Down Expand Up @@ -516,8 +518,8 @@ inline bool ZSTDNotFinal_Supported() {
}

inline bool ZSTD_Streaming_Supported() {
#ifdef ZSTD
return ZSTD_versionNumber() >= 10300;
#if defined(ZSTD) && defined(ZSTD_STREAMING)
return true;
#else
return false;
#endif
Expand Down

0 comments on commit 844a351

Please sign in to comment.