_MSC_VER

Stephan Bergmann sbergman at redhat.com
Thu Oct 13 08:49:28 UTC 2016


<https://blogs.msdn.microsoft.com/vcblog/2016/10/05/visual-c-compiler-version/> 
announces that details of the predefined _MSC_VER macro will change 
slightly for future releases of Visual Studio.  Beginning with "VS '15' 
Preview 5' the lower two digits of _MSC_VER will increase with updates, 
instead of staying at "00".  That means that checks for compilers up to 
and including a certain version (regardless of update) shouldn't be done 
with

   #if _MSC_VER <= xx00

(Curiously, that blog post claims that "VS '15' Preview 5" has an 
_MSC_VER of 1910, i.e., still using the same major 19xx as the existing 
Visual Studio 2015, aka MSVC 14.)

I checked our code base, and the only use of "_MSC_VER <= 1900" is in 
include/rtl/stringutils.hxx, checking for a bug that is known to be 
present at least up to current Visual Studio 2015, so doing the check 
that way is correct for now (until we find out whether or not that bug 
is fixed in "VS '15' Preview 5" or later).  (There's also a handful of 
"_MSC_VER <= 1800" in sal/osl/w32/salinit.cxx and 
vcl/source/opengl/OpenGLHelper.cxx that should arguably be "_MSC_VER < 
1900", but those should be harmless, as there'll presumably be no 
updates to Visual Studio 2013 that bump to 18xx > 1800.)


More information about the LibreOffice mailing list