11cb0ef41Sopenharmony_ciFrom 0c7de17000659f4f79de878296892c46be0aff77 Mon Sep 17 00:00:00 2001 21cb0ef41Sopenharmony_ciFrom: Noel Gordon <noel@chromium.org> 31cb0ef41Sopenharmony_ciDate: Wed, 26 May 2021 21:57:43 +1000 41cb0ef41Sopenharmony_ciSubject: [PATCH] Build minizip zip and unzip tools 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ci--- 71cb0ef41Sopenharmony_ci third_party/zlib/contrib/minizip/miniunz.c | 13 ++++++------- 81cb0ef41Sopenharmony_ci third_party/zlib/contrib/minizip/minizip.c | 7 +++---- 91cb0ef41Sopenharmony_ci 2 files changed, 9 insertions(+), 11 deletions(-) 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_cidiff --git a/third_party/zlib/contrib/minizip/miniunz.c b/third_party/zlib/contrib/minizip/miniunz.c 121cb0ef41Sopenharmony_ciindex 3d65401be5cd..08737f689a96 100644 131cb0ef41Sopenharmony_ci--- a/third_party/zlib/contrib/minizip/miniunz.c 141cb0ef41Sopenharmony_ci+++ b/third_party/zlib/contrib/minizip/miniunz.c 151cb0ef41Sopenharmony_ci@@ -12,7 +12,7 @@ 161cb0ef41Sopenharmony_ci Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 171cb0ef41Sopenharmony_ci */ 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ci-#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) 201cb0ef41Sopenharmony_ci+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) && (!defined(__ANDROID_API__)) 211cb0ef41Sopenharmony_ci #ifndef __USE_FILE_OFFSET64 221cb0ef41Sopenharmony_ci #define __USE_FILE_OFFSET64 231cb0ef41Sopenharmony_ci #endif 241cb0ef41Sopenharmony_ci@@ -27,7 +27,7 @@ 251cb0ef41Sopenharmony_ci #endif 261cb0ef41Sopenharmony_ci #endif 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_ci-#ifdef __APPLE__ 291cb0ef41Sopenharmony_ci+#if defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) 301cb0ef41Sopenharmony_ci // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions 311cb0ef41Sopenharmony_ci #define FOPEN_FUNC(filename, mode) fopen(filename, mode) 321cb0ef41Sopenharmony_ci #define FTELLO_FUNC(stream) ftello(stream) 331cb0ef41Sopenharmony_ci@@ -45,6 +45,7 @@ 341cb0ef41Sopenharmony_ci #include <time.h> 351cb0ef41Sopenharmony_ci #include <errno.h> 361cb0ef41Sopenharmony_ci #include <fcntl.h> 371cb0ef41Sopenharmony_ci+#include <sys/stat.h> 381cb0ef41Sopenharmony_ci 391cb0ef41Sopenharmony_ci #ifdef _WIN32 401cb0ef41Sopenharmony_ci # include <direct.h> 411cb0ef41Sopenharmony_ci@@ -97,7 +98,7 @@ void change_file_date(filename,dosdate,tmu_date) 421cb0ef41Sopenharmony_ci SetFileTime(hFile,&ftm,&ftLastAcc,&ftm); 431cb0ef41Sopenharmony_ci CloseHandle(hFile); 441cb0ef41Sopenharmony_ci #else 451cb0ef41Sopenharmony_ci-#ifdef unix || __APPLE__ 461cb0ef41Sopenharmony_ci+#if defined(unix) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) 471cb0ef41Sopenharmony_ci struct utimbuf ut; 481cb0ef41Sopenharmony_ci struct tm newdate; 491cb0ef41Sopenharmony_ci newdate.tm_sec = tmu_date.tm_sec; 501cb0ef41Sopenharmony_ci@@ -125,11 +126,9 @@ int mymkdir(dirname) 511cb0ef41Sopenharmony_ci const char* dirname; 521cb0ef41Sopenharmony_ci { 531cb0ef41Sopenharmony_ci int ret=0; 541cb0ef41Sopenharmony_ci-#ifdef _WIN32 551cb0ef41Sopenharmony_ci+#if defined(_WIN32) 561cb0ef41Sopenharmony_ci ret = _mkdir(dirname); 571cb0ef41Sopenharmony_ci-#elif unix 581cb0ef41Sopenharmony_ci- ret = mkdir (dirname,0775); 591cb0ef41Sopenharmony_ci-#elif __APPLE__ 601cb0ef41Sopenharmony_ci+#elif defined(unix) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) 611cb0ef41Sopenharmony_ci ret = mkdir (dirname,0775); 621cb0ef41Sopenharmony_ci #endif 631cb0ef41Sopenharmony_ci return ret; 641cb0ef41Sopenharmony_cidiff --git a/third_party/zlib/contrib/minizip/minizip.c b/third_party/zlib/contrib/minizip/minizip.c 651cb0ef41Sopenharmony_ciindex 4288962ecef0..b794953c5c23 100644 661cb0ef41Sopenharmony_ci--- a/third_party/zlib/contrib/minizip/minizip.c 671cb0ef41Sopenharmony_ci+++ b/third_party/zlib/contrib/minizip/minizip.c 681cb0ef41Sopenharmony_ci@@ -12,8 +12,7 @@ 691cb0ef41Sopenharmony_ci Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 701cb0ef41Sopenharmony_ci */ 711cb0ef41Sopenharmony_ci 721cb0ef41Sopenharmony_ci- 731cb0ef41Sopenharmony_ci-#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) 741cb0ef41Sopenharmony_ci+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) && (!defined(__ANDROID_API__)) 751cb0ef41Sopenharmony_ci #ifndef __USE_FILE_OFFSET64 761cb0ef41Sopenharmony_ci #define __USE_FILE_OFFSET64 771cb0ef41Sopenharmony_ci #endif 781cb0ef41Sopenharmony_ci@@ -28,7 +27,7 @@ 791cb0ef41Sopenharmony_ci #endif 801cb0ef41Sopenharmony_ci #endif 811cb0ef41Sopenharmony_ci 821cb0ef41Sopenharmony_ci-#ifdef __APPLE__ 831cb0ef41Sopenharmony_ci+#if defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) 841cb0ef41Sopenharmony_ci // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions 851cb0ef41Sopenharmony_ci #define FOPEN_FUNC(filename, mode) fopen(filename, mode) 861cb0ef41Sopenharmony_ci #define FTELLO_FUNC(stream) ftello(stream) 871cb0ef41Sopenharmony_ci@@ -94,7 +93,7 @@ uLong filetime(f, tmzip, dt) 881cb0ef41Sopenharmony_ci return ret; 891cb0ef41Sopenharmony_ci } 901cb0ef41Sopenharmony_ci #else 911cb0ef41Sopenharmony_ci-#ifdef unix || __APPLE__ 921cb0ef41Sopenharmony_ci+#if defined(unix) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) 931cb0ef41Sopenharmony_ci uLong filetime(f, tmzip, dt) 941cb0ef41Sopenharmony_ci char *f; /* name of file to get info on */ 951cb0ef41Sopenharmony_ci tm_zip *tmzip; /* return value: access, modific. and creation times */ 961cb0ef41Sopenharmony_ci-- 971cb0ef41Sopenharmony_ci2.31.1.818.g46aad6cb9e-goog 981cb0ef41Sopenharmony_ci 99