]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
MinGW-w64 requires _FILE_OFFSET_BITS 64
authorPrzemyslaw Skibinski <inikep@gmail.com>
Mon, 13 Feb 2017 12:57:29 +0000 (13:57 +0100)
committerPrzemyslaw Skibinski <inikep@gmail.com>
Mon, 13 Feb 2017 12:57:29 +0000 (13:57 +0100)
programs/platform.h
programs/util.h

index 1b53e1f85b534d86f03b1b7aa26a88364849c7d7..89a9f6cd42a01df74000ed57078edd923bd2c473 100644 (file)
@@ -51,8 +51,8 @@ extern "C" {
 /* *********************************************************
 *  Turn on Large Files support (>4GB) for 32-bit Linux/Unix
 ***********************************************************/
-#if !defined(__64BIT__)                               /* No point defining Large file for 64 bit */
-#  if !defined(_FILE_OFFSET_BITS)   
+#if !defined(__64BIT__) || defined(__MINGW32__)       /* No point defining Large file for 64 bit but MinGW-w64 requires it */
+#  if !defined(_FILE_OFFSET_BITS)
 #    define _FILE_OFFSET_BITS 64                      /* turn off_t into a 64-bit type for ftello, fseeko */
 #  endif
 #  if !defined(_LARGEFILE_SOURCE)                     /* obsolete macro, replaced with _FILE_OFFSET_BITS */
index 16bd3bdfca09cc3ae0c02a62689fa459caddc0bc..fe132d38de6a027343ceb54a32bd104a934a34f1 100644 (file)
@@ -187,7 +187,7 @@ UTIL_STATIC U64 UTIL_getFileSize(const char* infilename)
 {
     int r;
 #if defined(_MSC_VER)
-    struct _stat64 statbuf;
+    struct __stat64 statbuf;
     r = _stat64(infilename, &statbuf);
     if (r || !(statbuf.st_mode & S_IFREG)) return 0;   /* No good... */
 #elif defined(__MINGW32__) && defined (__MSVCRT__)