mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Merge pull request #926 from lestera/patch-1
Fix exceptions on file size calculation on Windows XP x64 and Windows Server 2003 x64
This commit is contained in:
commit
3eba3224c8
@ -210,10 +210,10 @@ inline size_t filesize(FILE *f)
|
|||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
int fd = _fileno(f);
|
int fd = _fileno(f);
|
||||||
#if _WIN64 // 64 bits
|
#if _WIN64 // 64 bits
|
||||||
struct _stat64 st;
|
__int64 ret = _filelengthi64(fd);
|
||||||
if (_fstat64(fd, &st) == 0)
|
if (ret >= 0)
|
||||||
{
|
{
|
||||||
return st.st_size;
|
return static_cast<size_t>(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // windows 32 bits
|
#else // windows 32 bits
|
||||||
|
Loading…
Reference in New Issue
Block a user