Skip to content

Commit

Permalink
Fix compiling with minizip-ng
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
droidmonkey committed Apr 3, 2022
1 parent 656e616 commit 31db3c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/keeshare/CMakeLists.txt
Expand Up @@ -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)
9 changes: 8 additions & 1 deletion src/keeshare/ShareExport.cpp
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/keeshare/ShareImport.cpp
Expand Up @@ -21,7 +21,7 @@
#include "keys/PasswordKey.h"

#include <QBuffer>
#include <unzip.h>
#include <minizip/unzip.h>

namespace
{
Expand Down

0 comments on commit 31db3c3

Please sign in to comment.