关于_MSC_VER的涵义


VC的头文件中经常会看到:
#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    

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值