mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
Merge pull request #540 from ds77/dev-stat64-fix
zstdcli: Fix reporting incorrect sizes of large flies on MinGW
This commit is contained in:
@ -143,7 +143,7 @@ UTIL_STATIC void UTIL_waitForNextTick(UTIL_time_t ticksPerSecond)
|
|||||||
******************************************/
|
******************************************/
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#define chmod _chmod
|
#define chmod _chmod
|
||||||
typedef struct _stat64 stat_t;
|
typedef struct __stat64 stat_t;
|
||||||
#else
|
#else
|
||||||
typedef struct stat stat_t;
|
typedef struct stat stat_t;
|
||||||
#endif
|
#endif
|
||||||
@ -190,6 +190,10 @@ UTIL_STATIC U64 UTIL_getFileSize(const char* infilename)
|
|||||||
struct _stat64 statbuf;
|
struct _stat64 statbuf;
|
||||||
r = _stat64(infilename, &statbuf);
|
r = _stat64(infilename, &statbuf);
|
||||||
if (r || !(statbuf.st_mode & S_IFREG)) return 0; /* No good... */
|
if (r || !(statbuf.st_mode & S_IFREG)) return 0; /* No good... */
|
||||||
|
#elif defined(__MINGW32__) && defined (__MSVCRT__)
|
||||||
|
struct _stati64 statbuf;
|
||||||
|
r = _stati64(infilename, &statbuf);
|
||||||
|
if (r || !(statbuf.st_mode & S_IFREG)) return 0; /* No good... */
|
||||||
#else
|
#else
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
r = stat(infilename, &statbuf);
|
r = stat(infilename, &statbuf);
|
||||||
@ -213,7 +217,7 @@ UTIL_STATIC int UTIL_doesFileExists(const char* infilename)
|
|||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
struct _stat64 statbuf;
|
struct __stat64 statbuf;
|
||||||
r = _stat64(infilename, &statbuf);
|
r = _stat64(infilename, &statbuf);
|
||||||
if (r || !(statbuf.st_mode & S_IFREG)) return 0; /* No good... */
|
if (r || !(statbuf.st_mode & S_IFREG)) return 0; /* No good... */
|
||||||
#else
|
#else
|
||||||
@ -229,7 +233,7 @@ UTIL_STATIC U32 UTIL_isDirectory(const char* infilename)
|
|||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
struct _stat64 statbuf;
|
struct __stat64 statbuf;
|
||||||
r = _stat64(infilename, &statbuf);
|
r = _stat64(infilename, &statbuf);
|
||||||
if (!r && (statbuf.st_mode & _S_IFDIR)) return 1;
|
if (!r && (statbuf.st_mode & _S_IFDIR)) return 1;
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user