VC++预定义符

Microsoft 特定

注意16 位和 32 位编译器都支持这些宏。
   Macro               Specifies
   ------------------------------------------------------------------

   _CHAR_UNSIGNED      Default char type is unsigned. Macro defined
                       when /J is specified.
   M_I86,  _M_I86      Always defined. Identifies target machine as a
                       member of the 8086 family.
   _MSC_VER            Microsoft C version; currently defined as 800.
				
在 C/c + + 7.0 中添加了以下符号:
   Macro               Specifies
   --------------------------------------------------------------------

   __cplusplus         Macro defined when compiling a C++ program. (This
                       macro is not defined for the C compiler.)
				

Microsoft 特定

   Macro               Specifies
   -------------------------------------------------------------------

   MSDOS, _MSDOS       Always defined. Identifies target operating system
                       as MS-DOS.
   M_I86mM, _M_I86mM   Always defined. Member of the I86 processor family.
                       Memory model type:
                       m = T   Tiny
                       S   Small (default)
                       C   Compact model
                       M   Medium model
                       L   Large model
                       H   Huge model
                       Macros defined by /AT, /AS, /AC, /AM, /AL, and /AH
                       respectively.
   M_I8086, _M_I8086   8088 or 8086 processor; default or defined when /G0
                       is specified.
   M_I286, _M_I286     80286 processor. Macro defined when /G1 or /G2 is
                       specified.
   NO_EXT_KEYS         Disables Microsoft-specific language extensions
                       and extended keywords; defined only with /Za
                       option.

   _QC                 Supported for compatibility with Microsoft C version
                       6.0. The _FAST macro (or /f) is the default and is
                       the recommended alternative.
				
在 C/c + + 7.0 中添加了下列符号:
   Macro               Specifies
   -------------------------------------------------------------------

   _DLL                Code for run-time library as a dynamic-link library.
                       Defined when /MD is specified.
   _FAST               Fast-Compile. Macro defined when /f is specified
                       Supersedes _QC, which is still supported but not
                       recommended. Using /Od causes CL to compile your
                       program with /f. The /f option compiles source files
                       without any default optimizations.
   __STDC__            Full conformance with the ANSI C standard. Defined
                       the integer constant 1 only if the /Za command-line
                       option is given; otherwise is undefined.
   _PCODE              Defined for sections of code that are compiled as
                       p-code. Macro defined when /Oq is enabled.
   _WINDLL             Windows protected-mode dynamic-link library is
                       selected with /GD.
   _WINDOWS            Windows protected-mode is selected with /GA, /Gw,
                       /GW, /Mq, or /GD.
				

16 位特定于

在 Visual c + +,32-位版本 1.0 版中添加了下列符号:
   Macro               Specifies
   -----               ---------

   _DLL                Defined when Multithreaded using DLL (/MD or /MDd)
                       is specified.

   _M_IX86             Defined as 300 for the 80386 processor (/G3 option),
                       as 400 for the 80486 (/G4) processor, as 500
                       for the Pentium processor (/G5), and as 600 for 
                       Pentium Pro and Pentium II processors (/G6).

   _MT                 Defined when Multithreaded (/MD, /MDd, /MT, or /MTd)


   _WIN32              Defined for WIN32 applications. Always defined.
                       Microsoft specific.
				
Visual c + +,32-位版本 4.0 版中添加的下列符号:
   Macro               Specifies
   -----               ---------

   _CPPRTTI            Defined for code compiled with Enable Run-Time Type
                       Information (/GR).

   _CPPUNWIND          Defined for code compiled with Enable Exception
                       Handling (/GX).
				
_MSC_VER 宏将具有取决于特定的 Microsoft 编译器为下列值之一:
   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
				
笔记 如果预定义的标识符有两种使用和不使用下划线的形式,命令行的驱动程序定义两个如果指定/ze 选项 (对于 Microsoft 扩展编译)。如果指定/za 选项 (编译 ANSI 兼容性),它定义了只有前导下划线窗体。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值