Skip to content

Commit

Permalink
fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Coeur committed Nov 1, 2024
1 parent 8cca408 commit 84fd490
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,7 @@ target_include_directories(${MINIZIP_TARGET} PUBLIC
if(MZ_COMPAT)
target_include_directories(${MINIZIP_TARGET} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/compat/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
${ZLIB_SOURCE_DIR}
${ZLIB_BINARY_DIR})
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
endif()

# Install files
Expand Down
5 changes: 4 additions & 1 deletion compat/crypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
*/

#ifndef _ZLIB_H
# if (ZLIB_VERNUM & 0xf != 0xf) && (ZLIB_VERNUM < 0x1270)
# ifndef ZLIB_VERNUM
/* HAVE_ZLIB but no ZLIB_VERNUM? */
typedef uint32_t z_crc_t;
# elif (ZLIB_VERNUM & 0xf != 0xf) && (ZLIB_VERNUM < 0x1270)
/* Define z_crc_t in zlib 1.2.6 and less */
typedef unsigned long z_crc_t;
# elif (ZLIB_VERNUM & 0xf == 0xf) && (ZLIB_VERNUM < 0x12df)
Expand Down
6 changes: 5 additions & 1 deletion compat/ioapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
#include <stdint.h>

#ifndef _ZLIB_H
#include "zlib.h"
# if __has_include(<zlib.h>)
# include <zlib.h>
# elif __has_include(<zlib-ng.h>)
# include <zlib-ng.h>
# endif
#endif

typedef uint64_t ZPOS64_T;
Expand Down
5 changes: 4 additions & 1 deletion mz_crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ int32_t mz_crypt_rand(uint8_t *buf, int32_t size) {

uint32_t mz_crypt_crc32_update(uint32_t value, const uint8_t *buf, int32_t size) {
#if defined(HAVE_ZLIB)
# if (ZLIB_VERNUM & 0xf != 0xf) && (ZLIB_VERNUM < 0x1270)
# ifndef ZLIB_VERNUM
/* HAVE_ZLIB but no ZLIB_VERNUM? */
typedef uint32_t z_crc_t;
# elif (ZLIB_VERNUM & 0xf != 0xf) && (ZLIB_VERNUM < 0x1270)
/* Define z_crc_t in zlib 1.2.6 and less */
typedef unsigned long z_crc_t;
# elif (ZLIB_VERNUM & 0xf == 0xf) && (ZLIB_VERNUM < 0x12df)
Expand Down

0 comments on commit 84fd490

Please sign in to comment.