From eab41c1872fbaf99a949bc082c3169a754d7d147 Mon Sep 17 00:00:00 2001 From: Sean Purcell Date: Wed, 26 Apr 2017 10:17:38 -0700 Subject: [PATCH] Fix LZ4 wrapper deprecation warnings --- programs/fileio.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/programs/fileio.c b/programs/fileio.c index 2bf5cb209..70d35ad67 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -534,17 +534,22 @@ static unsigned long long FIO_compressLz4Frame(cRess_t* ress, const char* srcFil memset(&prefs, 0, sizeof(prefs)); +#if LZ4_VERSION_NUMBER <= 10600 +#define LZ4F_blockIndependent blockIndependent +#define LZ4F_max4MB max4MB +#endif + prefs.autoFlush = 1; prefs.compressionLevel = compressionLevel; - prefs.frameInfo.blockMode = blockIndependent; /* stick to defaults for lz4 cli */ - prefs.frameInfo.blockSizeID = max4MB; + prefs.frameInfo.blockMode = LZ4F_blockIndependent; /* stick to defaults for lz4 cli */ + prefs.frameInfo.blockSizeID = LZ4F_max4MB; prefs.frameInfo.contentChecksumFlag = (contentChecksum_t)g_checksumFlag; #if LZ4_VERSION_NUMBER >= 10600 prefs.frameInfo.contentSize = srcFileSize; #endif { - size_t blockSize = FIO_LZ4_GetBlockSize_FromBlockId(max4MB); + size_t blockSize = FIO_LZ4_GetBlockSize_FromBlockId(LZ4F_max4MB); size_t readSize; size_t headerSize = LZ4F_compressBegin(ctx, ress->dstBuffer, ress->dstBufferSize, &prefs); if (LZ4F_isError(headerSize)) EXM_THROW(33, "File header generation failed : %s", LZ4F_getErrorName(headerSize)); -- 2.47.2