From 6b1800cb763eef9e7069a3e4270241f5e61f86aa Mon Sep 17 00:00:00 2001 From: abv Date: Wed, 12 Sep 2018 22:38:38 +0300 Subject: [PATCH] 0030130: Coding Rules - MSVC 2017 gives warnings about using of std::fpos::seekpos() within RWStl Use of deprecated method std::fpos::seekpos() is avoided with MSVC 11 (Visual Studio 2012) and above. --- src/RWStl/RWStl_Reader.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/RWStl/RWStl_Reader.cxx b/src/RWStl/RWStl_Reader.cxx index 19e22a3cff..89f5cb91ec 100644 --- a/src/RWStl/RWStl_Reader.cxx +++ b/src/RWStl/RWStl_Reader.cxx @@ -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)