Skip to content

Commit

Permalink
Expose zlib constants for backwards compat #747
Browse files Browse the repository at this point in the history
Building a project that had an internal copy of minizip 1.x, but
preferring an external library, with minizip 4.x showed that the
compat layer was not exposing some constants from zlib that
minizip 1.x headers did.
  • Loading branch information
brad0 committed Dec 22, 2023
1 parent 0211461 commit 0f8cf66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,9 @@ target_include_directories(${MINIZIP_TARGET} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
if(MZ_COMPAT)
target_include_directories(${MINIZIP_TARGET} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
${ZLIB_SOURCE_DIR}
${ZLIB_BINARY_DIR})
endif()

# Install files
Expand Down
7 changes: 4 additions & 3 deletions mz_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

#include "mz.h"

#ifndef ZLIB_H
#include <zlib.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -147,9 +151,6 @@ typedef const char *zipcharpc;
#define ZIP_BADZIPFILE (-103)
#define ZIP_INTERNALERROR (-104)

#ifndef Z_DEFLATED
#define Z_DEFLATED (8)
#endif
#define Z_BZIP2ED (12)

#define APPEND_STATUS_CREATE (0)
Expand Down

0 comments on commit 0f8cf66

Please sign in to comment.