0030130: Coding Rules - MSVC 2017 gives warnings about using of std::fpos::seekpos...
[occt.git] / src / RWStl / RWStl_Reader.cxx
index 19e22a3..89f5cb9 100644 (file)
@@ -223,7 +223,10 @@ Standard_Boolean RWStl_Reader::IsAscii (Standard_IStream& theStream)
 #endif
 
 // Macro to get 64-bit position of the file from streampos
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && _MSC_VER < 1700
+  // In MSVC 2010, cast of streampos to 64-bit int is implemented incorrectly;
+  // work-around (relevant for files larger than 4 GB) is to use internal function seekpos(). 
+  // Since MSVC 15.8, seekpos() is deprecated and is said to always return 0.
   #define GETPOS(aPos) aPos.seekpos()
 #else
   #define GETPOS(aPos) ((int64_t)aPos)