From 7a82b4b17b924334cd37bc51ff56ed2bcef68ce1 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 11 Feb 2022 17:14:05 +0200 Subject: [PATCH] add patch for compiling zip.c with tcc on windows --- thirdparty/zip/miniz.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/thirdparty/zip/miniz.h b/thirdparty/zip/miniz.h index 926e8658af..b00266d725 100644 --- a/thirdparty/zip/miniz.h +++ b/thirdparty/zip/miniz.h @@ -228,6 +228,10 @@ #define MINIZ_HAS_64BIT_REGISTERS 0 #endif +#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)) +#define __WINDOWS__ +#endif + #ifdef __cplusplus extern "C" { #endif @@ -4942,7 +4946,12 @@ static int mz_mkdir(const char *pDirname) { #define MZ_FFLUSH fflush #define MZ_FREOPEN(f, m, s) freopen(f, m, s) #define MZ_DELETE_FILE remove + +#if defined(__WINDOWS__) +#define MZ_MKDIR(d) _mkdir(d) +#else #define MZ_MKDIR(d) mkdir(d, 0755) +#endif #elif defined(__USE_LARGEFILE64) /* gcc, clang */ #ifndef MINIZ_NO_TIME