commit
33b672288c
|
@ -63,7 +63,7 @@ inline int select_fseek(FILE *file, int64_t offset, int origin) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined _WIN64 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
|
#if defined _WIN32 && (!defined __GNUC__ || !defined __CLANG__ && __MSVCRT_VERSION__ >= 0x0601)
|
||||||
template <>
|
template <>
|
||||||
inline size_t select_ftell<8>(FILE *file) {
|
inline size_t select_ftell<8>(FILE *file) {
|
||||||
return (size_t)::_ftelli64(file);
|
return (size_t)::_ftelli64(file);
|
||||||
|
@ -74,7 +74,7 @@ inline int select_fseek<8>(FILE *file, int64_t offset, int origin) {
|
||||||
return ::_fseeki64(file, offset, origin);
|
return ::_fseeki64(file, offset, origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ size_t DefaultIOStream::FileSize() const {
|
||||||
//
|
//
|
||||||
// See here for details:
|
// See here for details:
|
||||||
// https://www.securecoding.cert.org/confluence/display/seccode/FIO19-C.+Do+not+use+fseek()+and+ftell()+to+compute+the+size+of+a+regular+file
|
// https://www.securecoding.cert.org/confluence/display/seccode/FIO19-C.+Do+not+use+fseek()+and+ftell()+to+compute+the+size+of+a+regular+file
|
||||||
#if defined _WIN64 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
|
#if defined _WIN32 && (!defined __GNUC__ || !defined __CLANG__ && __MSVCRT_VERSION__ >= 0x0601)
|
||||||
struct __stat64 fileStat;
|
struct __stat64 fileStat;
|
||||||
//using fileno + fstat avoids having to handle the filename
|
//using fileno + fstat avoids having to handle the filename
|
||||||
int err = _fstat64(_fileno(mFile), &fileStat);
|
int err = _fstat64(_fileno(mFile), &fileStat);
|
||||||
|
|
Loading…
Reference in New Issue