VC预定义宏

一、ANSI C标准预定义宏

__LINE__ 、__FILE__ 、__DATE__ 、__TIME__、__STDC__ 、__TIMESTAMP__

 

MSDN上的注解:

__DATE__

The compilation date of the current source file. The date is a string literal of the form Mmm dd yyyy.

The month name Mmm is the same as for dates generated by the library function asctimedeclared in

TIME.H.

 

__FILE__

The name of the current source file. __FILE__ expands to a string surrounded by double quotation

marks.

 

__LINE__

The line number in the current source file. The line number is a decimal integer constant. It can be

altered with a #line directive.

 

__STDC__

Indicates full conformance with the ANSI C standard. Defined as the integer constant 1 only if the /Za

compiler option is given and you are not compiling C++ code; otherwise is undefined.

 

__TIME__

The most recent compilation time of the current source file. The time is a string literal of the

form hh:mm:ss.

 

__TIMESTAMP__

The date and time of the last modification of the current source file, expressed as a string literal in

the form Ddd Mmm Date hh:mm:ss yyyy, where Ddd is the abbreviated day of the week andDate is

aninteger from 1 to 31.

 

二 、VC指定的预定义宏

_ATL_VER 、_CHAR_UNSIGNED 、__CLR_VER 、__cplusplus_cli 、__COUNTER____cplusplus 、_CPPLIB_VER 、_CPPRTTI 、_CPPUNWIND 、_DEBUG_DLL、__FUNCDNAME__ 、__FUNCSIG__ 、__FUNCTION__ 、_INTEGRAL_MAX_BITS 、_M_ALPHA 、_M_CEE 、_M_CEE_PURE 、_M_CEE_SAFE 、_M_IX86 、_M_IA64 、_M_IX86_FP 、_M_MPPC 、_M_MRX000 、_M_PPC 、_M_X64 、_MANAGED 、_MFC_VER 、__MSVC_RUNTIME_CHECKS 、_MT 、_NATIVE_WCHAR_T_DEFINED 、_OPENMP 、_VC_NODEFAULTLIB 、_WCHAR_T_DEFINED 、_WIN32 、_WIN64 、_Wp64 。

 

摘选部分MSDN上的注解(更多了解到http://msdn.microsoft.com/en-us/library/b0084kay.aspx):

__COUNTER__

Expands to an integer starting with 0 and incrementing by 1 every time it is used in a compiland.

 

__cplusplus

Defined for C++ programs only.

 

_DEBUG

Defined when compiling with /LDd, /MDd, and /MTd.

 

_DLL

Defined when /MD or /MDd (Multithread DLL) is specified.

 

_MT

Defined when /MD or /MDd (Multithreaded DLL) or /MT or /MTd (Multithreaded) is specified.

 

_WCHAR_T_DEFINED

Defined when /Zc:wchar_t is used or if wchar_t is defined in a system header file included in your project.

 

_WIN32

Defined for applications for Win32 and Win64. Always defined.

 

_WIN64

Defined for applications for Win64.

转载于:https://www.cnblogs.com/qinfengxiaoyue/archive/2012/05/26/2519689.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值