From: Przemyslaw Skibinski Date: Wed, 15 Feb 2017 16:03:16 +0000 (+0100) Subject: added UTIL_fseek X-Git-Tag: v1.1.4~1^2~56^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e59b3ce0180b02e81bfa8fc1829567cb0c2e1a9;p=thirdparty%2Fzstd.git added UTIL_fseek --- diff --git a/programs/util.h b/programs/util.h index 364aa650f..c03bd1d19 100644 --- a/programs/util.h +++ b/programs/util.h @@ -39,6 +39,20 @@ extern "C" { #include "mem.h" /* U32, U64 */ +/* ************************************************************ +* Avoid fseek()'s 2GiB barrier with MSVC, MacOS, *BSD, MinGW +***************************************************************/ +#if defined(_MSC_VER) && (_MSC_VER >= 1400) +# define UTIL_fseek _fseeki64 +#elif !defined(__64BIT__) && (PLATFORM_POSIX_VERSION >= 200112L) /* No point defining Large file for 64 bit */ +# define UTIL_fseek fseeko +#elif defined(__MINGW32__) && defined(__MSVCRT__) && !defined(__STRICT_ANSI__) && !defined(__NO_MINGW_LFS) +# define UTIL_fseek fseeko64 +#else +# define UTIL_fseek fseek +#endif + + /*-**************************************** * Sleep functions: Windows - Posix - others ******************************************/