diff options
author | James Addison <jay@jp-hosting.net> | 2023-11-17 15:23:04 +0000 |
---|---|---|
committer | James Addison <jay@jp-hosting.net> | 2023-11-17 16:24:00 +0000 |
commit | 7e8c968bba72160a1f670ffd016cb9ca3ed9fc80 (patch) | |
tree | 7230be2da9d7b57162a791db07b8bd526fc47455 /src/minizip/ioapi.c | |
parent | bb87aa0146f25be9f034076a6b71142c16616961 (diff) |
Manually re-apply diff: ioapi.c
Diffstat (limited to 'src/minizip/ioapi.c')
-rw-r--r-- | src/minizip/ioapi.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/minizip/ioapi.c b/src/minizip/ioapi.c index 782d324..3a594b8 100644 --- a/src/minizip/ioapi.c +++ b/src/minizip/ioapi.c @@ -14,7 +14,7 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#if defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64) +#if defined(__APPLE__) || defined(__ANDROID__) || defined(IOAPI_NO_64) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64) // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions #define FOPEN_FUNC(filename, mode) fopen(filename, mode) #define FTELLO_FUNC(stream) ftello(stream) @@ -68,6 +68,7 @@ void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filef p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; + p_filefunc64_32->zfile_func64.zflush_file = p_filefunc32->zflush_file; p_filefunc64_32->zfile_func64.ztell64_file = NULL; p_filefunc64_32->zfile_func64.zseek64_file = NULL; p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; @@ -193,6 +194,12 @@ static long ZCALLBACK fseek64_file_func(voidpf opaque, voidpf stream, ZPOS64_T o return ret; } +static int ZCALLBACK fflush_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = fflush((FILE *)stream); + return ret; +} static int ZCALLBACK fclose_file_func(voidpf opaque, voidpf stream) { int ret; @@ -214,6 +221,7 @@ void fill_fopen_filefunc(zlib_filefunc_def* pzlib_filefunc_def) { pzlib_filefunc_def->zwrite_file = fwrite_file_func; pzlib_filefunc_def->ztell_file = ftell_file_func; pzlib_filefunc_def->zseek_file = fseek_file_func; + pzlib_filefunc_def->zflush_file = fflush_file_func; pzlib_filefunc_def->zclose_file = fclose_file_func; pzlib_filefunc_def->zerror_file = ferror_file_func; pzlib_filefunc_def->opaque = NULL; @@ -225,6 +233,7 @@ void fill_fopen64_filefunc(zlib_filefunc64_def* pzlib_filefunc_def) { pzlib_filefunc_def->zwrite_file = fwrite_file_func; pzlib_filefunc_def->ztell64_file = ftell64_file_func; pzlib_filefunc_def->zseek64_file = fseek64_file_func; + pzlib_filefunc_def->zflush_file = fflush_file_func; pzlib_filefunc_def->zclose_file = fclose_file_func; pzlib_filefunc_def->zerror_file = ferror_file_func; pzlib_filefunc_def->opaque = NULL; |