diff --git a/src/STDInclude.hpp b/src/STDInclude.hpp index 58e65b3e..3b5ecb59 100644 --- a/src/STDInclude.hpp +++ b/src/STDInclude.hpp @@ -74,7 +74,7 @@ template class Sizer { }; #pragma warning(disable: 6387) // #include -// #include +#include #define ZWRAP_USE_ZSTD 1 #include diff --git a/src/Utils/Compression.cpp b/src/Utils/Compression.cpp index 6b772ef1..73e5d8c3 100644 --- a/src/Utils/Compression.cpp +++ b/src/Utils/Compression.cpp @@ -17,7 +17,8 @@ namespace Utils char* buffer = allocator.allocateArray(length); - if (compress2(reinterpret_cast(buffer), &length, reinterpret_cast(const_cast(data.data())), data.size(), Z_BEST_COMPRESSION) != Z_OK) + int level = (ZWRAP_isUsingZSTDcompression() ? ZSTD_maxCLevel() : Z_BEST_COMPRESSION); + if (compress2(reinterpret_cast(buffer), &length, reinterpret_cast(const_cast(data.data())), data.size(), level) != Z_OK) { return ""; }