Skip to content

Commit 4aba08d

Browse files
authored
thirdparty: update zip to commit 6f2116d from https://github.com/kuba--/zip/ (#21121)
1 parent 9c9608b commit 4aba08d

File tree

3 files changed

+330
-116
lines changed

3 files changed

+330
-116
lines changed

thirdparty/zip/miniz.h

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4968,20 +4968,36 @@ static FILE *mz_fopen(const char *pFilename, const char *pMode) {
49684968
WCHAR *wFilename = mz_utf8z_to_widechar(pFilename);
49694969
WCHAR *wMode = mz_utf8z_to_widechar(pMode);
49704970
FILE *pFile = NULL;
4971+
#ifdef ZIP_ENABLE_SHARABLE_FILE_OPEN
4972+
pFile = _wfopen(wFilename, wMode);
4973+
#else
49714974
errno_t err = _wfopen_s(&pFile, wFilename, wMode);
4975+
#endif
49724976
free(wFilename);
49734977
free(wMode);
4978+
#ifdef ZIP_ENABLE_SHARABLE_FILE_OPEN
4979+
return pFile;
4980+
#else
49744981
return err ? NULL : pFile;
4982+
#endif
49754983
}
49764984

49774985
static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream) {
49784986
WCHAR *wPath = mz_utf8z_to_widechar(pPath);
49794987
WCHAR *wMode = mz_utf8z_to_widechar(pMode);
49804988
FILE *pFile = NULL;
4989+
#ifdef ZIP_ENABLE_SHARABLE_FILE_OPEN
4990+
pFile = _wfreopen(wPath, wMode, pStream);
4991+
#else
49814992
errno_t err = _wfreopen_s(&pFile, wPath, wMode, pStream);
4993+
#endif
49824994
free(wPath);
49834995
free(wMode);
4996+
#ifdef ZIP_ENABLE_SHARABLE_FILE_OPEN
4997+
return pFile;
4998+
#else
49844999
return err ? NULL : pFile;
5000+
#endif
49855001
}
49865002

49875003
static int mz_stat64(const char *path, struct __stat64 *buffer) {
@@ -4999,15 +5015,12 @@ static int mz_mkdir(const char *pDirname) {
49995015
}
50005016

50015017
#ifndef MINIZ_NO_TIME
5002-
50035018
#if (defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)) && !defined(FREEBSD)
5004-
#include <utime.h>
5019+
#include <utime.h>
50055020
#else
5006-
#include <sys/utime.h>
5021+
#include <sys/utime.h>
50075022
#endif
5008-
50095023
#endif
5010-
50115024
#define MZ_FOPEN mz_fopen
50125025
#define MZ_FCLOSE fclose
50135026
#define MZ_FREAD fread
@@ -5022,11 +5035,13 @@ static int mz_mkdir(const char *pDirname) {
50225035
#define MZ_MKDIR(d) mz_mkdir(d)
50235036

50245037
#elif defined(__MINGW32__) || defined(__WATCOMC__)
5025-
50265038
#ifndef MINIZ_NO_TIME
5027-
#include <sys/utime.h>
5039+
#if (defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)) && !defined(FREEBSD)
5040+
#include <utime.h>
5041+
#else
5042+
#include <sys/utime.h>
5043+
#endif
50285044
#endif
5029-
50305045
#define MZ_FOPEN(f, m) fopen(f, m)
50315046
#define MZ_FCLOSE fclose
50325047
#define MZ_FREAD fread
@@ -5041,15 +5056,12 @@ static int mz_mkdir(const char *pDirname) {
50415056
#define MZ_MKDIR(d) _mkdir(d)
50425057

50435058
#elif defined(__TINYC__)
5044-
50455059
#ifndef MINIZ_NO_TIME
5046-
50475060
#if (defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)) && !defined(FREEBSD)
5048-
#include <utime.h>
5061+
#include <utime.h>
50495062
#else
5050-
#include <sys/utime.h>
5063+
#include <sys/utime.h>
50515064
#endif
5052-
50535065
#endif
50545066
#define MZ_FOPEN(f, m) fopen(f, m)
50555067
#define MZ_FCLOSE fclose

0 commit comments

Comments
 (0)