From 074237d6bc366930d70cc9dc2e63a46779aaac1a Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Sat, 23 Nov 2024 19:51:31 +0300 Subject: [PATCH 1/3] Avoid "64" functions on Android < 24 taken from #436 --- contrib/minizip/ioapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/minizip/ioapi.c b/contrib/minizip/ioapi.c index 782d32469..a789e1075 100644 --- a/contrib/minizip/ioapi.c +++ b/contrib/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(IOAPI_NO_64) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64) || (__ANDROID_API__ && __ANDROID_API__ < 24) // 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) From 64411236144aefa5607b463451f0424b1884f96e Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Sat, 23 Nov 2024 19:53:43 +0300 Subject: [PATCH 2/3] __USE_FILE_OFFSET64 should be disabled on Android < 24 --- contrib/minizip/ioapi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/minizip/ioapi.h b/contrib/minizip/ioapi.h index f3b193d80..4ed435658 100644 --- a/contrib/minizip/ioapi.h +++ b/contrib/minizip/ioapi.h @@ -21,7 +21,7 @@ #ifndef ZLIBIOAPI64_H #define ZLIBIOAPI64_H -#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) +#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) && !(defined(__ANDROID_API__) && __ANDROID_API__ < 24) // Linux needs this to support file operation on files larger then 4+GB // But might need better if/def to select just the platforms that needs them. From aa10b1bb7a238a5eec21f699dc21ef0d03513c13 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Sat, 23 Nov 2024 19:56:08 +0300 Subject: [PATCH 3/3] use `defined` instead of plain check --- contrib/minizip/ioapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/minizip/ioapi.c b/contrib/minizip/ioapi.c index a789e1075..6f43cdd98 100644 --- a/contrib/minizip/ioapi.c +++ b/contrib/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) || (__ANDROID_API__ && __ANDROID_API__ < 24) +#if defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64) || (defined(__ANDROID_API__) && __ANDROID_API__ < 24) // 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)