mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +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__)
|
||||
int fd = _fileno(f);
|
||||
#if _WIN64 // 64 bits
|
||||
struct _stat64 st;
|
||||
if (_fstat64(fd, &st) == 0)
|
||||
__int64 ret = _filelengthi64(fd);
|
||||
if (ret >= 0)
|
||||
{
|
||||
return st.st_size;
|
||||
return static_cast<size_t>(ret);
|
||||
}
|
||||
|
||||
#else // windows 32 bits
|
||||
|
Loading…
Reference in New Issue
Block a user