]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Avoid fseek()'s 2GiB barrier with MacOS and *BSD
authorPrzemyslaw Skibinski <inikep@gmail.com>
Tue, 14 Feb 2017 08:45:33 +0000 (09:45 +0100)
committerPrzemyslaw Skibinski <inikep@gmail.com>
Tue, 14 Feb 2017 08:45:33 +0000 (09:45 +0100)
programs/fileio.c

index b8d4ef02d2c9f5de28c829c08984b55e53855042..c152fdcbee89f5a6c15fcaf19a176fa6c30e78a9 100644 (file)
@@ -91,8 +91,13 @@ static clock_t g_time = 0;
 
 #define MIN(a,b)    ((a) < (b) ? (a) : (b))
 
+/* ************************************************************
+* Avoid fseek()'s 2GiB barrier with MSVC, MacOS, *BSD, MinGW
+***************************************************************/
 #if defined(_MSC_VER) && _MSC_VER >= 1400
 #   define LONG_SEEK _fseeki64
+#elif !defined(__64BIT__) && (PLATFORM_POSIX_VERSION >= 200112L) /* No point defining Large file for 64 bit */
+#  define fseek fseeko
 #elif defined(__MINGW32__) && !defined(__STRICT_ANSI__) && !defined(__NO_MINGW_LFS) && defined(__MSVCRT__)
 #   define LONG_SEEK fseeko64
 #elif defined(_WIN32) && !defined(__DJGPP__)