Fix compiling with minizip-ng

* minizip-ng has slightly different defines and function names than the original minizip. These changes adapt the existing code to use the minizip-ng versions if necessary.
This commit is contained in:
Jonathan White 2022-03-24 22:53:02 -04:00
parent 656e6161a0
commit 31db3c325d
3 changed files with 9 additions and 3 deletions

View File

@ -17,6 +17,5 @@ if(WITH_XC_KEESHARE)
add_library(keeshare STATIC ${keeshare_SOURCES})
target_link_libraries(keeshare PUBLIC Qt5::Core Qt5::Widgets ${BOTAN2_LIBRARIES} ${ZLIB_LIBRARIES} PRIVATE ${MINIZIP_LIBRARIES})
target_include_directories(keeshare SYSTEM PRIVATE ${MINIZIP_INCLUDE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
endif(WITH_XC_KEESHARE)

View File

@ -27,7 +27,14 @@
#include <QBuffer>
#include <botan/pubkey.h>
#include <zip.h>
#include <minizip/zip.h>
// Compatibility with minizip-ng
#ifdef MZ_VERSION_BUILD
#undef Z_BEST_COMPRESSION
#define Z_BEST_COMPRESSION MZ_COMPRESS_LEVEL_BEST
#define zipOpenNewFileInZip64 zipOpenNewFileInZip_64
#endif
namespace
{

View File

@ -21,7 +21,7 @@
#include "keys/PasswordKey.h"
#include <QBuffer>
#include <unzip.h>
#include <minizip/unzip.h>
namespace
{