11cb0ef41Sopenharmony_cidiff --git a/contrib/minizip/iowin32.c b/contrib/minizip/iowin32.c 21cb0ef41Sopenharmony_ciindex 274f39eb1dd2..246ceb91a139 100644 31cb0ef41Sopenharmony_ci--- a/contrib/minizip/iowin32.c 41cb0ef41Sopenharmony_ci+++ b/contrib/minizip/iowin32.c 51cb0ef41Sopenharmony_ci@@ -26,12 +26,19 @@ 61cb0ef41Sopenharmony_ci #endif 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ci+#ifdef _WIN32_WINNT 101cb0ef41Sopenharmony_ci+#undef _WIN32_WINNT 111cb0ef41Sopenharmony_ci+#define _WIN32_WINNT 0x601 121cb0ef41Sopenharmony_ci+#endif 131cb0ef41Sopenharmony_ci+ 141cb0ef41Sopenharmony_ci+#if _WIN32_WINNT >= _WIN32_WINNT_WIN8 151cb0ef41Sopenharmony_ci // see Include/shared/winapifamily.h in the Windows Kit 161cb0ef41Sopenharmony_ci #if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API))) 171cb0ef41Sopenharmony_ci #if WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP) 181cb0ef41Sopenharmony_ci #define IOWIN32_USING_WINRT_API 1 191cb0ef41Sopenharmony_ci #endif 201cb0ef41Sopenharmony_ci #endif 211cb0ef41Sopenharmony_ci+#endif 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_ci voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode)); 241cb0ef41Sopenharmony_ci uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); 251cb0ef41Sopenharmony_cidiff --git a/contrib/minizip/unzip.c b/contrib/minizip/unzip.c 261cb0ef41Sopenharmony_ciindex bcfb9416ec35..199b4723fcfc 100644 271cb0ef41Sopenharmony_ci--- a/contrib/minizip/unzip.c 281cb0ef41Sopenharmony_ci+++ b/contrib/minizip/unzip.c 291cb0ef41Sopenharmony_ci@@ -1705,11 +1705,6 @@ extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) 301cb0ef41Sopenharmony_ci 311cb0ef41Sopenharmony_ci pfile_in_zip_read_info->stream.avail_out = (uInt)len; 321cb0ef41Sopenharmony_ci 331cb0ef41Sopenharmony_ci- if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && 341cb0ef41Sopenharmony_ci- (!(pfile_in_zip_read_info->raw))) 351cb0ef41Sopenharmony_ci- pfile_in_zip_read_info->stream.avail_out = 361cb0ef41Sopenharmony_ci- (uInt)pfile_in_zip_read_info->rest_read_uncompressed; 371cb0ef41Sopenharmony_ci- 381cb0ef41Sopenharmony_ci if ((len>pfile_in_zip_read_info->rest_read_compressed+ 391cb0ef41Sopenharmony_ci pfile_in_zip_read_info->stream.avail_in) && 401cb0ef41Sopenharmony_ci (pfile_in_zip_read_info->raw)) 411cb0ef41Sopenharmony_cidiff --git a/gzread.c b/gzread.c 421cb0ef41Sopenharmony_ciindex 956b91ea7d9e..832d3ef98c59 100644 431cb0ef41Sopenharmony_ci--- a/gzread.c 441cb0ef41Sopenharmony_ci+++ b/gzread.c 451cb0ef41Sopenharmony_ci@@ -443,7 +443,11 @@ z_size_t ZEXPORT gzfread(buf, size, nitems, file) 461cb0ef41Sopenharmony_ci # undef z_gzgetc 471cb0ef41Sopenharmony_ci #else 481cb0ef41Sopenharmony_ci # undef gzgetc 491cb0ef41Sopenharmony_ci+# ifdef Z_CR_PREFIX_SET 501cb0ef41Sopenharmony_ci+# define gzgetc Cr_z_gzgetc 511cb0ef41Sopenharmony_ci+# endif 521cb0ef41Sopenharmony_ci #endif 531cb0ef41Sopenharmony_ci+ 541cb0ef41Sopenharmony_ci int ZEXPORT gzgetc(file) 551cb0ef41Sopenharmony_ci gzFile file; 561cb0ef41Sopenharmony_ci { 571cb0ef41Sopenharmony_cidiff --git a/zconf.h b/zconf.h 581cb0ef41Sopenharmony_ciindex 5e1d68a004e9..a7a815f575a7 100644 591cb0ef41Sopenharmony_ci--- a/zconf.h 601cb0ef41Sopenharmony_ci+++ b/zconf.h 611cb0ef41Sopenharmony_ci@@ -8,6 +8,10 @@ 621cb0ef41Sopenharmony_ci #ifndef ZCONF_H 631cb0ef41Sopenharmony_ci #define ZCONF_H 641cb0ef41Sopenharmony_ci 651cb0ef41Sopenharmony_ci+/* 661cb0ef41Sopenharmony_ci+ * This library is also built as a part of AOSP, which does not need to include 671cb0ef41Sopenharmony_ci+ * chromeconf.h. This config does not want chromeconf.h, so it can set this 681cb0ef41Sopenharmony_ci+ * macro to opt out. While this works today, there's no guarantee that building 691cb0ef41Sopenharmony_ci+ * zlib outside of Chromium keeps working in the future. 701cb0ef41Sopenharmony_ci+ */ 711cb0ef41Sopenharmony_ci+#if !defined(CHROMIUM_ZLIB_NO_CHROMECONF) 721cb0ef41Sopenharmony_ci+/* This include does prefixing as below, but with an updated set of names. Also 731cb0ef41Sopenharmony_ci+ * sets up export macros in component builds. */ 741cb0ef41Sopenharmony_ci+#include "chromeconf.h" 751cb0ef41Sopenharmony_ci+#endif 761cb0ef41Sopenharmony_ci+ 771cb0ef41Sopenharmony_ci /* 781cb0ef41Sopenharmony_ci * If you *really* need a unique prefix for all types and library functions, 791cb0ef41Sopenharmony_ci * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. 801cb0ef41Sopenharmony_ci@@ -431,7 +434,7 @@ typedef uLong FAR uLongf; 811cb0ef41Sopenharmony_ci typedef unsigned long z_crc_t; 821cb0ef41Sopenharmony_ci #endif 831cb0ef41Sopenharmony_ci 841cb0ef41Sopenharmony_ci-#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ 851cb0ef41Sopenharmony_ci+#if !defined(_WIN32) 861cb0ef41Sopenharmony_ci # define Z_HAVE_UNISTD_H 871cb0ef41Sopenharmony_ci #endif 881cb0ef41Sopenharmony_ci 891cb0ef41Sopenharmony_cidiff --git a/zlib.h b/zlib.h 901cb0ef41Sopenharmony_ciindex f09cdaf1e054..99fd467f6b1a 100644 911cb0ef41Sopenharmony_ci--- a/zlib.h 921cb0ef41Sopenharmony_ci+++ b/zlib.h 931cb0ef41Sopenharmony_ci@@ -1824,6 +1824,11 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ 941cb0ef41Sopenharmony_ci # undef z_gzgetc 951cb0ef41Sopenharmony_ci # define z_gzgetc(g) \ 961cb0ef41Sopenharmony_ci ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) 971cb0ef41Sopenharmony_ci+#elif defined(Z_CR_PREFIX_SET) 981cb0ef41Sopenharmony_ci+# undef gzgetc 991cb0ef41Sopenharmony_ci+# define gzgetc(g) \ 1001cb0ef41Sopenharmony_ci+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) \ 1011cb0ef41Sopenharmony_ci+ : (Cr_z_gzgetc)(g)) 1021cb0ef41Sopenharmony_ci #else 1031cb0ef41Sopenharmony_ci # define gzgetc(g) \ 1041cb0ef41Sopenharmony_ci ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) 1051cb0ef41Sopenharmony_ci@@ -1853,11 +1858,29 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ 1061cb0ef41Sopenharmony_ci # define z_adler32_combine z_adler32_combine64 1071cb0ef41Sopenharmony_ci # define z_crc32_combine z_crc32_combine64 1081cb0ef41Sopenharmony_ci # else 1091cb0ef41Sopenharmony_ci+# ifdef gzopen 1101cb0ef41Sopenharmony_ci+# undef gzopen 1111cb0ef41Sopenharmony_ci+# endif 1121cb0ef41Sopenharmony_ci # define gzopen gzopen64 1131cb0ef41Sopenharmony_ci+# ifdef gzseek 1141cb0ef41Sopenharmony_ci+# undef gzseek 1151cb0ef41Sopenharmony_ci+# endif 1161cb0ef41Sopenharmony_ci # define gzseek gzseek64 1171cb0ef41Sopenharmony_ci+# ifdef gztell 1181cb0ef41Sopenharmony_ci+# undef gztell 1191cb0ef41Sopenharmony_ci+# endif 1201cb0ef41Sopenharmony_ci # define gztell gztell64 1211cb0ef41Sopenharmony_ci+# ifdef gzoffset 1221cb0ef41Sopenharmony_ci+# undef gzoffset 1231cb0ef41Sopenharmony_ci+# endif 1241cb0ef41Sopenharmony_ci # define gzoffset gzoffset64 1251cb0ef41Sopenharmony_ci+# ifdef adler32_combine 1261cb0ef41Sopenharmony_ci+# undef adler32_combine 1271cb0ef41Sopenharmony_ci+# endif 1281cb0ef41Sopenharmony_ci # define adler32_combine adler32_combine64 1291cb0ef41Sopenharmony_ci+# ifdef crc32_combine 1301cb0ef41Sopenharmony_ci+# undef crc32_combine 1311cb0ef41Sopenharmony_ci+# endif 1321cb0ef41Sopenharmony_ci # define crc32_combine crc32_combine64 1331cb0ef41Sopenharmony_ci # endif 1341cb0ef41Sopenharmony_ci # ifndef Z_LARGE64 1351cb0ef41Sopenharmony_cidiff --git a/zutil.h b/zutil.h 1361cb0ef41Sopenharmony_ciindex b079ea6a80f5..80375b8b6109 100644 1371cb0ef41Sopenharmony_ci--- a/zutil.h 1381cb0ef41Sopenharmony_ci+++ b/zutil.h 1391cb0ef41Sopenharmony_ci@@ -28,6 +28,21 @@ 1401cb0ef41Sopenharmony_ci # include <string.h> 1411cb0ef41Sopenharmony_ci # include <stdlib.h> 1421cb0ef41Sopenharmony_ci #endif 1431cb0ef41Sopenharmony_ci+#ifdef NO_ERRNO_H 1441cb0ef41Sopenharmony_ci+# ifdef _WIN32_WCE 1451cb0ef41Sopenharmony_ci+ /* The Microsoft C Run-Time Library for Windows CE doesn't have 1461cb0ef41Sopenharmony_ci+ * errno. We define it as a global variable to simplify porting. 1471cb0ef41Sopenharmony_ci+ * Its value is always 0 and should not be used. We rename it to 1481cb0ef41Sopenharmony_ci+ * avoid conflict with other libraries that use the same workaround. 1491cb0ef41Sopenharmony_ci+ */ 1501cb0ef41Sopenharmony_ci+# define errno z_errno 1511cb0ef41Sopenharmony_ci+# endif 1521cb0ef41Sopenharmony_ci+ extern int errno; 1531cb0ef41Sopenharmony_ci+#else 1541cb0ef41Sopenharmony_ci+# ifndef _WIN32_WCE 1551cb0ef41Sopenharmony_ci+# include <errno.h> 1561cb0ef41Sopenharmony_ci+# endif 1571cb0ef41Sopenharmony_ci+#endif 1581cb0ef41Sopenharmony_ci 1591cb0ef41Sopenharmony_ci #ifdef Z_SOLO 1601cb0ef41Sopenharmony_ci typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ 161