#if _MSC_VER > 1000
#pragma once
#endif
这是微软的预编译控制; 在_MSC_VER较小时,它对一些设置的支持与新版不同,所以需要此限制。
_MSC_VER是什么呢?
MS:Microsoft;
C:MSC就是Microsoft的C编译器;
VER:Version;
即:Microsoft的C编译器的版本
#pragma once //意思是这个文件在编译时只被编译器包括一次,用于防止头文件被重复包括;
#if _MSC_VER > 1000
是指如果VC编译器的版本大于1000则这个语句被编译。
摘录:
Defines the compiler version. Defined as 1200 for Microsoft Visual C++ 6.0. Always defined.
The _MSC_VER macro will have one of the following values depending upon the particular Microsoft compiler:
Compiler _MSC_VER value
-------- --------------
C Compiler version 6.0 600
C/C++ compiler version 7.0 700
Visual C++, Windows, version 1.0 800
Visual C++, 32-bit, version 1.0 800
Visual C++, Windows, version 2.0 900
Visual C++, 32-bit, version 2.x 900
Visual C++, 32-bit, version 4.0 1000
Visual C++, 32-bit, version 5.0 1100
Visual C++, 32-bit, version 6.0 1200