Fix LZ4 wrapper deprecation warnings
This commit is contained in:
+8
-3
@@ -534,17 +534,22 @@ static unsigned long long FIO_compressLz4Frame(cRess_t* ress, const char* srcFil
|
|||||||
|
|
||||||
memset(&prefs, 0, sizeof(prefs));
|
memset(&prefs, 0, sizeof(prefs));
|
||||||
|
|
||||||
|
#if LZ4_VERSION_NUMBER <= 10600
|
||||||
|
#define LZ4F_blockIndependent blockIndependent
|
||||||
|
#define LZ4F_max4MB max4MB
|
||||||
|
#endif
|
||||||
|
|
||||||
prefs.autoFlush = 1;
|
prefs.autoFlush = 1;
|
||||||
prefs.compressionLevel = compressionLevel;
|
prefs.compressionLevel = compressionLevel;
|
||||||
prefs.frameInfo.blockMode = blockIndependent; /* stick to defaults for lz4 cli */
|
prefs.frameInfo.blockMode = LZ4F_blockIndependent; /* stick to defaults for lz4 cli */
|
||||||
prefs.frameInfo.blockSizeID = max4MB;
|
prefs.frameInfo.blockSizeID = LZ4F_max4MB;
|
||||||
prefs.frameInfo.contentChecksumFlag = (contentChecksum_t)g_checksumFlag;
|
prefs.frameInfo.contentChecksumFlag = (contentChecksum_t)g_checksumFlag;
|
||||||
#if LZ4_VERSION_NUMBER >= 10600
|
#if LZ4_VERSION_NUMBER >= 10600
|
||||||
prefs.frameInfo.contentSize = srcFileSize;
|
prefs.frameInfo.contentSize = srcFileSize;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
size_t blockSize = FIO_LZ4_GetBlockSize_FromBlockId(max4MB);
|
size_t blockSize = FIO_LZ4_GetBlockSize_FromBlockId(LZ4F_max4MB);
|
||||||
size_t readSize;
|
size_t readSize;
|
||||||
size_t headerSize = LZ4F_compressBegin(ctx, ress->dstBuffer, ress->dstBufferSize, &prefs);
|
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));
|
if (LZ4F_isError(headerSize)) EXM_THROW(33, "File header generation failed : %s", LZ4F_getErrorName(headerSize));
|
||||||
|
|||||||
Reference in New Issue
Block a user