some msvc changes

This commit is contained in:
Jean-Francois Dockes
2020-04-03 07:33:27 +01:00
parent 34d23589a2
commit b0fb7612ee
6 changed files with 1267 additions and 18 deletions
+7
View File
@@ -2939,6 +2939,7 @@ extern "C" {
#include <sys/stat.h>
#if defined(_MSC_VER) || defined(__MINGW64__)
#if defined(__MINGW64__)
static FILE *mz_fopen(const char *pFilename, const char *pMode)
{
FILE *pFile = NULL;
@@ -2952,11 +2953,17 @@ static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream)
return NULL;
return pFile;
}
#endif /* MINGW64 */
#ifndef MINIZ_NO_TIME
#include <sys/utime.h>
#endif
#if defined(__MINGW64__)
#define MZ_FOPENREAD mz_fopen
#define MZ_FOPEN mz_fopen
#else /*->msc*/
#define MZ_FOPENREAD(f, m) _wfopen(f, m)
#define MZ_FOPEN(f, m) fopen(f, m)
#endif
#define MZ_FCLOSE fclose
#define MZ_FREAD fread
#define MZ_FWRITE fwrite
+5 -1
View File
@@ -22,7 +22,11 @@
#ifdef _WIN32
// needed for localtime_r under mingw?
#define _POSIX_THREAD_SAFE_FUNCTIONS
#endif
#ifdef _MSC_VER
#define localtime_r(a,b) localtime_s(b,a)
#endif /* _MSC_VER */
#endif /* _WIN32 */
#include <time.h>
#include <ctype.h>
#include <errno.h>