_MSC_VER的含义:
Reports the major and minor versions of the compiler. For example, 1310 for Microsoft Visual C++ .NET 2003. 1310 represents version 13 and a 1.0 point release. The Visual C++ 2005 compiler version is 1400.
Type cl /? at the command line to see the major and minor versions of your compiler along with the build number.
翻译:
_MSC_VER代表的是Visual studio的c++编译器的主版本和副版本号。
各个版本的_MSC_VER如下:
版本号: visual studio版本 十进制值
vc++ 5.0 VS 5.0 1100
vc++ 6.0 VS 6.0 1200
vc++7.0 VS 2003 1310
vc++ 8.0() VS 2005 1400
vc++9.0() VS 2008 1500
你可以根据这个预定义的宏在头文件里来判断visual studio的版本。
比如:
#if _MSC_VER > 1310
.......
.......
.......
#endif