From: Przemyslaw Skibinski Date: Fri, 10 Feb 2017 19:09:28 +0000 (+0100) Subject: fix for original MinGW X-Git-Tag: v1.1.4~1^2~72^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=645f5b98563d584e7a12aa7179c05252688acdd4;p=thirdparty%2Fzstd.git fix for original MinGW --- diff --git a/programs/platform.h b/programs/platform.h index 5aeee3325..1b53e1f85 100644 --- a/programs/platform.h +++ b/programs/platform.h @@ -51,7 +51,7 @@ extern "C" { /* ********************************************************* * Turn on Large Files support (>4GB) for 32-bit Linux/Unix ***********************************************************/ -#if !defined(__64BIT__) || defined(__MINGW32__) /* No point defining Large file for 64 bit but MinGW requires it */ +#if !defined(__64BIT__) /* No point defining Large file for 64 bit */ # if !defined(_FILE_OFFSET_BITS) # define _FILE_OFFSET_BITS 64 /* turn off_t into a 64-bit type for ftello, fseeko */ # endif diff --git a/programs/util.h b/programs/util.h index 656b3a96b..58077ccc4 100644 --- a/programs/util.h +++ b/programs/util.h @@ -141,9 +141,9 @@ UTIL_STATIC void UTIL_waitForNextTick(UTIL_time_t ticksPerSecond) /*-**************************************** * File functions ******************************************/ -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__MINGW32__) #define chmod _chmod - typedef struct _stat64 stat_t; + typedef struct __stat64 stat_t; #else typedef struct stat stat_t; #endif @@ -172,7 +172,7 @@ UTIL_STATIC int UTIL_setFileStat(const char *filename, stat_t *statbuf) UTIL_STATIC int UTIL_getFileStat(const char* infilename, stat_t *statbuf) { int r; -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__MINGW32__) r = _stat64(infilename, statbuf); if (r || !(statbuf->st_mode & S_IFREG)) return 0; /* No good... */ #else @@ -186,8 +186,8 @@ UTIL_STATIC int UTIL_getFileStat(const char* infilename, stat_t *statbuf) UTIL_STATIC U64 UTIL_getFileSize(const char* infilename) { int r; -#if defined(_MSC_VER) - struct _stat64 statbuf; +#if defined(_MSC_VER) || defined(__MINGW32__) + struct __stat64 statbuf; r = _stat64(infilename, &statbuf); if (r || !(statbuf.st_mode & S_IFREG)) return 0; /* No good... */ #else