Merge pull request #240 from AMDmi3/freebsd

Fix compatibility with FreeBSD and improve readability in miniz_zip.c
This commit is contained in:
Martin Raiber 2022-07-09 13:00:58 +02:00 committed by GitHub
commit be92575500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,6 +96,7 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
#define MZ_FFLUSH fflush #define MZ_FFLUSH fflush
#define MZ_FREOPEN mz_freopen #define MZ_FREOPEN mz_freopen
#define MZ_DELETE_FILE remove #define MZ_DELETE_FILE remove
#elif defined(__MINGW32__) || defined(__WATCOMC__) #elif defined(__MINGW32__) || defined(__WATCOMC__)
#ifndef MINIZ_NO_TIME #ifndef MINIZ_NO_TIME
#include <sys/utime.h> #include <sys/utime.h>
@ -111,6 +112,7 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
#define MZ_FFLUSH fflush #define MZ_FFLUSH fflush
#define MZ_FREOPEN(f, m, s) freopen(f, m, s) #define MZ_FREOPEN(f, m, s) freopen(f, m, s)
#define MZ_DELETE_FILE remove #define MZ_DELETE_FILE remove
#elif defined(__TINYC__) #elif defined(__TINYC__)
#ifndef MINIZ_NO_TIME #ifndef MINIZ_NO_TIME
#include <sys/utime.h> #include <sys/utime.h>
@ -126,6 +128,7 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
#define MZ_FFLUSH fflush #define MZ_FFLUSH fflush
#define MZ_FREOPEN(f, m, s) freopen(f, m, s) #define MZ_FREOPEN(f, m, s) freopen(f, m, s)
#define MZ_DELETE_FILE remove #define MZ_DELETE_FILE remove
#elif defined(__USE_LARGEFILE64) /* gcc, clang */ #elif defined(__USE_LARGEFILE64) /* gcc, clang */
#ifndef MINIZ_NO_TIME #ifndef MINIZ_NO_TIME
#include <utime.h> #include <utime.h>
@ -141,7 +144,8 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
#define MZ_FFLUSH fflush #define MZ_FFLUSH fflush
#define MZ_FREOPEN(p, m, s) freopen64(p, m, s) #define MZ_FREOPEN(p, m, s) freopen64(p, m, s)
#define MZ_DELETE_FILE remove #define MZ_DELETE_FILE remove
#elif defined(__APPLE__)
#elif defined(__APPLE__) || defined(__FreeBSD__)
#ifndef MINIZ_NO_TIME #ifndef MINIZ_NO_TIME
#include <utime.h> #include <utime.h>
#endif #endif