mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Convert off_t to size_t
This commit is contained in:
parent
541dd88a97
commit
9b218d4d12
@ -216,11 +216,11 @@ inline size_t filesize(FILE *f)
|
||||
#if !defined(__FreeBSD__) && !defined(__APPLE__) && (defined(__x86_64__) || defined(__ppc64__))
|
||||
struct stat64 st;
|
||||
if (fstat64(fd, &st) == 0)
|
||||
return st.st_size;
|
||||
return static_cast<size_t>(st.st_size);
|
||||
#else // unix 32 bits or osx
|
||||
struct stat st;
|
||||
if (fstat(fd, &st) == 0)
|
||||
return st.st_size;
|
||||
return static_cast<size_t>(st.st_size);
|
||||
#endif
|
||||
#endif
|
||||
throw spdlog_ex("Failed getting file size from fd", errno);
|
||||
|
Loading…
Reference in New Issue
Block a user