fix_x86_windows_build.patch 1.1 KB

12345678910111213141516171819202122
  1. diff --git a/code/Common/DefaultIOStream.cpp b/code/Common/DefaultIOStream.cpp
  2. index e30f26acd3..17fc44f9a2 100644
  3. --- a/code/Common/DefaultIOStream.cpp
  4. +++ b/code/Common/DefaultIOStream.cpp
  5. @@ -63,7 +63,7 @@ inline int select_fseek(FILE *file, int64_t offset, int origin) {
  6. -#if defined _WIN64 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
  7. +#if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
  8. template <>
  9. inline size_t select_ftell<8>(FILE *file) {
  10. return (size_t)::_ftelli64(file);
  11. @@ -149,7 +149,7 @@ size_t DefaultIOStream::FileSize() const {
  12. //
  13. // See here for details:
  14. // https://www.securecoding.cert.org/confluence/display/seccode/FIO19-C.+Do+not+use+fseek()+and+ftell()+to+compute+the+size+of+a+regular+file
  15. -#if defined _WIN64 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
  16. +#if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
  17. struct __stat64 fileStat;
  18. //using fileno + fstat avoids having to handle the filename
  19. int err = _fstat64(_fileno(mFile), &fileStat);