1From 0c7de17000659f4f79de878296892c46be0aff77 Mon Sep 17 00:00:00 2001 2From: Noel Gordon <noel@chromium.org> 3Date: Wed, 26 May 2021 21:57:43 +1000 4Subject: [PATCH] Build minizip zip and unzip tools 5 6--- 7 third_party/zlib/contrib/minizip/miniunz.c | 13 ++++++------- 8 third_party/zlib/contrib/minizip/minizip.c | 7 +++---- 9 2 files changed, 9 insertions(+), 11 deletions(-) 10 11diff --git a/third_party/zlib/contrib/minizip/miniunz.c b/third_party/zlib/contrib/minizip/miniunz.c 12index 3d65401be5cd..08737f689a96 100644 13--- a/third_party/zlib/contrib/minizip/miniunz.c 14+++ b/third_party/zlib/contrib/minizip/miniunz.c 15@@ -12,7 +12,7 @@ 16 Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 17 */ 18 19-#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) 20+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) && (!defined(__ANDROID_API__)) 21 #ifndef __USE_FILE_OFFSET64 22 #define __USE_FILE_OFFSET64 23 #endif 24@@ -27,7 +27,7 @@ 25 #endif 26 #endif 27 28-#ifdef __APPLE__ 29+#if defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) 30 // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions 31 #define FOPEN_FUNC(filename, mode) fopen(filename, mode) 32 #define FTELLO_FUNC(stream) ftello(stream) 33@@ -45,6 +45,7 @@ 34 #include <time.h> 35 #include <errno.h> 36 #include <fcntl.h> 37+#include <sys/stat.h> 38 39 #ifdef _WIN32 40 # include <direct.h> 41@@ -97,7 +98,7 @@ void change_file_date(filename,dosdate,tmu_date) 42 SetFileTime(hFile,&ftm,&ftLastAcc,&ftm); 43 CloseHandle(hFile); 44 #else 45-#ifdef unix || __APPLE__ 46+#if defined(unix) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) 47 struct utimbuf ut; 48 struct tm newdate; 49 newdate.tm_sec = tmu_date.tm_sec; 50@@ -125,11 +126,9 @@ int mymkdir(dirname) 51 const char* dirname; 52 { 53 int ret=0; 54-#ifdef _WIN32 55+#if defined(_WIN32) 56 ret = _mkdir(dirname); 57-#elif unix 58- ret = mkdir (dirname,0775); 59-#elif __APPLE__ 60+#elif defined(unix) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) 61 ret = mkdir (dirname,0775); 62 #endif 63 return ret; 64diff --git a/third_party/zlib/contrib/minizip/minizip.c b/third_party/zlib/contrib/minizip/minizip.c 65index 4288962ecef0..b794953c5c23 100644 66--- a/third_party/zlib/contrib/minizip/minizip.c 67+++ b/third_party/zlib/contrib/minizip/minizip.c 68@@ -12,8 +12,7 @@ 69 Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 70 */ 71 72- 73-#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) 74+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) && (!defined(__ANDROID_API__)) 75 #ifndef __USE_FILE_OFFSET64 76 #define __USE_FILE_OFFSET64 77 #endif 78@@ -28,7 +27,7 @@ 79 #endif 80 #endif 81 82-#ifdef __APPLE__ 83+#if defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) 84 // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions 85 #define FOPEN_FUNC(filename, mode) fopen(filename, mode) 86 #define FTELLO_FUNC(stream) ftello(stream) 87@@ -94,7 +93,7 @@ uLong filetime(f, tmzip, dt) 88 return ret; 89 } 90 #else 91-#ifdef unix || __APPLE__ 92+#if defined(unix) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) 93 uLong filetime(f, tmzip, dt) 94 char *f; /* name of file to get info on */ 95 tm_zip *tmzip; /* return value: access, modific. and creation times */ 96-- 972.31.1.818.g46aad6cb9e-goog 98 99