mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
bump minimum zstd version requirement to v1.1.3
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
6bcca220a0
commit
e6516414be
2 changed files with 2 additions and 16 deletions
|
@ -255,8 +255,8 @@ set_package_properties(ICU PROPERTIES
|
|||
TYPE REQUIRED
|
||||
)
|
||||
|
||||
# v0.7.3+ required for ZSTD_getDecompressedSize()
|
||||
find_package(ZSTD 0.7.3)
|
||||
# v1.1.3+ required for exported ZSTD_getErrorString() and ZSTD_getErrorCode()
|
||||
find_package(ZSTD 1.1.3)
|
||||
set_package_properties(ZSTD PROPERTIES
|
||||
PURPOSE "Required for compression support"
|
||||
DESCRIPTION "Fast real-time compression algorithm"
|
||||
|
|
|
@ -53,12 +53,6 @@
|
|||
#include <zlib.h>
|
||||
#include <zstd.h>
|
||||
#include <zstd_errors.h>
|
||||
|
||||
// ZSTD_getErrorString and ZSTD_getErrorCode are not exported in versions prior to v1.1.3
|
||||
#if !defined(QT_VISIBILITY_AVAILABLE) || (ZSTD_VERSION_NUMBER >= 10103)
|
||||
# define QT_USE_ZSTD_ERROR
|
||||
#endif
|
||||
|
||||
#endif // QT_NO_COMPRESS
|
||||
|
||||
#define IS_RAW_DATA(d) ((d)->data != (d)->array)
|
||||
|
@ -559,11 +553,7 @@ QByteArray qFastCompress(const char* data, int nbytes, int compressionLevel)
|
|||
QByteArray result(bndresult, Qt::Uninitialized);
|
||||
const size_t cmpresult = ZSTD_compress(result.data(), result.size(), data, nbytes, compressionLevel);
|
||||
if (Q_UNLIKELY(ZSTD_isError(cmpresult))) {
|
||||
#ifdef QT_USE_ZSTD_ERROR
|
||||
qWarning("qFastCompress: Could not compress data (%s)", ZSTD_getErrorString(ZSTD_getErrorCode(cmpresult)));
|
||||
#else
|
||||
qWarning("qFastCompress: Could not compress data");
|
||||
#endif
|
||||
return QByteArray();
|
||||
}
|
||||
result.resize(cmpresult);
|
||||
|
@ -616,11 +606,7 @@ QByteArray qFastUncompress(const char* data, int nbytes)
|
|||
QByteArray result(uncompressedsize, Qt::Uninitialized);
|
||||
const size_t decresult = ZSTD_decompress(result.data(), result.size(), data, nbytes);
|
||||
if (Q_UNLIKELY(ZSTD_isError(decresult))) {
|
||||
#ifdef QT_USE_ZSTD_ERROR
|
||||
qWarning("qFastCompress: Could not uncompress data (%s)", ZSTD_getErrorString(ZSTD_getErrorCode(decresult)));
|
||||
#else
|
||||
qWarning("qFastCompress: Could not uncompress data");
|
||||
#endif
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue