From 6075739c34eb9045f0e10c7e6cbb2031971fe3f5 Mon Sep 17 00:00:00 2001 From: James Addison Date: Fri, 17 Nov 2023 15:32:04 +0000 Subject: Manually re-apply diff: ioapi.h --- src/minizip/ioapi.h | 25 +++++++++++++++++++++++++ src/minizip/ioapi.h.diff | 24 ++++++++++++------------ 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/minizip/ioapi.h b/src/minizip/ioapi.h index c588a18..0c45d72 100644 --- a/src/minizip/ioapi.h +++ b/src/minizip/ioapi.h @@ -21,6 +21,9 @@ #ifndef _ZLIBIOAPI64_H #define _ZLIBIOAPI64_H +#undef OF +#define OF(x) x + #if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) // Linux needs this to support file operation on files larger then 4+GB @@ -67,6 +70,24 @@ #endif #endif +/* As reported by sammyx, z_crc_t and z_const are not defined in pre-1.2.70 releases of zlib */ +/* See */ +#if ZLIB_VERNUM < 0x1270 + +#ifdef Z_U4 + typedef Z_U4 z_crc_t; +#else + typedef unsigned long z_crc_t; +#endif + +#if defined(ZLIB_CONST) && !defined(z_const) +# define z_const const +#else +# define z_const +#endif + +#endif + /* #ifndef ZPOS64_T #ifdef _WIN32 @@ -137,6 +158,7 @@ extern "C" { typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque, const char* filename, int mode); typedef uLong (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream, void* buf, uLong size); typedef uLong (ZCALLBACK *write_file_func) (voidpf opaque, voidpf stream, const void* buf, uLong size); +typedef int (ZCALLBACK *flush_file_func) (voidpf opaque, voidpf stream); typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream); typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream); @@ -150,6 +172,7 @@ typedef struct zlib_filefunc_def_s open_file_func zopen_file; read_file_func zread_file; write_file_func zwrite_file; + flush_file_func zflush_file; tell_file_func ztell_file; seek_file_func zseek_file; close_file_func zclose_file; @@ -166,6 +189,7 @@ typedef struct zlib_filefunc64_def_s open64_file_func zopen64_file; read_file_func zread_file; write_file_func zwrite_file; + flush_file_func zflush_file; tell64_file_func ztell64_file; seek64_file_func zseek64_file; close_file_func zclose_file; @@ -188,6 +212,7 @@ typedef struct zlib_filefunc64_32_def_s #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +#define ZFLUSH64(filefunc,filestream) ((*((filefunc).zfile_func64.zflush_file)) ((filefunc).zfile_func64.opaque,filestream)) //#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) //#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) diff --git a/src/minizip/ioapi.h.diff b/src/minizip/ioapi.h.diff index 6a21c11..3c6b674 100644 --- a/src/minizip/ioapi.h.diff +++ b/src/minizip/ioapi.h.diff @@ -1,5 +1,5 @@ ---- ioapi.h.orig 2022-11-20 19:28:12.877767071 +0100 -+++ ioapi.h 2023-01-15 11:29:37.790645280 +0100 +--- ioapi.h.orig 2023-11-17 16:21:50.359864777 +0000 ++++ ioapi.h 2023-11-17 16:24:00.239861504 +0000 @@ -21,6 +21,9 @@ #ifndef _ZLIBIOAPI64_H #define _ZLIBIOAPI64_H @@ -35,15 +35,15 @@ /* #ifndef ZPOS64_T #ifdef _WIN32 -@@ -135,6 +156,7 @@ - typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); - typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); - typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -+typedef int (ZCALLBACK *flush_file_func) OF((voidpf opaque, voidpf stream)); - typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); - typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); +@@ -137,6 +158,7 @@ + typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque, const char* filename, int mode); + typedef uLong (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream, void* buf, uLong size); + typedef uLong (ZCALLBACK *write_file_func) (voidpf opaque, voidpf stream, const void* buf, uLong size); ++typedef int (ZCALLBACK *flush_file_func) (voidpf opaque, voidpf stream); + typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream); + typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream); -@@ -148,6 +170,7 @@ +@@ -150,6 +172,7 @@ open_file_func zopen_file; read_file_func zread_file; write_file_func zwrite_file; @@ -51,7 +51,7 @@ tell_file_func ztell_file; seek_file_func zseek_file; close_file_func zclose_file; -@@ -164,6 +187,7 @@ +@@ -166,6 +189,7 @@ open64_file_func zopen64_file; read_file_func zread_file; write_file_func zwrite_file; @@ -59,7 +59,7 @@ tell64_file_func ztell64_file; seek64_file_func zseek64_file; close_file_func zclose_file; -@@ -186,6 +210,7 @@ +@@ -188,6 +212,7 @@ #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -- cgit v1.2.3