Macro |
Description |
_ Atl_ver |
Defines the ATL version. |
_ Char_unsigned |
DefaultCharType is unsigned. defined when /J is specified. |
_ Clr_ver |
Defines the version of the Common Language Runtime used when the application was compiled. The value returned will be in the following format: Mmmbbbbb Where, M is the major version of the runtime. Mm is the minor version of the runtime. Bbbbb is the build number. // clr_ver.cpp// compile with: /clrusing namespace System;int main() { Console::WriteLine(__CLR_VER);} |
_ Cplusplus_cli |
Defined when compiling/CLR,/CLR: pure, Or /CLR: safe. Value of _ cplusplus_cli is 200406. _ cplusplus_cli is in effect throughout the Translation Unit. // cplusplus_cli.cpp// compile with: /clr#include "stdio.h"int main() { #ifdef __cplusplus_cli printf("%d\n", __cplusplus_cli); #else printf("not defined\n"); #endif} |
_ Counter __ |
Expands to an integer starting with 0 and incrementing by 1 every time it is used in a compiland. _ Counter __Remembers its state when using precompiled headers. If the last _ Counter __Value was 4 after building a precompiled header (PCH), it will start with 5 on each PCH use. _ Counter __Lets you generate unique variable names. You can use token pasting with a prefix to make a unique name. For example: // pre_mac_counter.cpp#include <stdio.h>#define FUNC2(x,y) x##y#define FUNC1(x,y) FUNC2(x,y)#define FUNC(x) FUNC1(x,__COUNTER__)int FUNC(my_unique_prefix);int FUNC(my_unique_prefix);int main() { my_unique_prefix0 = 0; printf_s("\n%d",my_unique_prefix0); my_unique_prefix0++; printf_s("\n%d",my_unique_prefix0);} |
_ Cplusplus |
Defined for C ++ programs only. |
_ Cpplib_ver |
Defined if you include any of the C ++ standard library headers; reports which version of the dinkumware header files are present. |
_ Cpprtti |
Defined for Code Compiled /GR (enable run-time type information ). |
_ Cppunwind |
Defined for Code Compiled /GX (enable Exception Handling ). |
_ Debug |
Defined when compiling /LDD,/MDD, And/MTD. |
_ DLL |
Defined when /MD or/MDD (multithread DLL) is specified. |
_ Funcdname __ |
Valid only within a function and returns the decorated name of the enclosing function (as a string ). _ Funcdname __Is not expanded if you use /EP or /P compiler option. |
_ Funcsig __ |
Valid only within a function and returns the signature of the enclosing function (as a string ). _ Funcsig __Is not expanded if you use /EP or /P compiler option. On a 64-bit operating system, the calling convention is_ CdeclBy default. |
_ Function __ |
Valid only within a function and returns the undecorated name of the enclosing function (as a string ). _ Function __Is not expanded if you use /EP or /P compiler option. |
_ Integral_max_bits |
Reports the maximum size (in bits) for an integral type. // integral_max_bits.cpp#include <stdio.h>int main() { printf("%d\n", _INTEGRAL_MAX_BITS);} |
_ M_alpha |
Defined for DEC Alpha platforms (no longer supported ). |
_ M_cee |
Defined for a compilation that uses any form/CLR(/CLR: oldsyntax, /CLR: safe, For example ). |
_ M_cee_pure |
Defined for a compilation that uses/CLR: pure. |
_ M_cee_safe |
Defined for a compilation that uses/CLR: safe. |
_ M_ix86 |
Defined for x86 processors. See Values for _ m_ix86 for more details. |
_ M_ia64 |
Defined for itanium Processor family 64-bit processors. |
_ M_ix86_fp |
Expands to a value indicating which/ArchCompiler option was used:
|
_ M_mppc |
Defined for Power Macintosh platforms (no longer supported ). |
_ M_mrx000 |
Defined for MIPS platforms (no longer supported ). |
_ M_ppc |
Defined for PowerPC platforms (no longer supported ). |
_ M_x64 |
Defined for x64 processors. |
_ Managed |
Defined to be 1 when /CLR is specified. |
_ Mfc_ver |
Defines the MFC version. For example, 0x0700 represents MFC version 7. |
_ Msc_extensions |
This macro is defined when compiling with /Ze compiler option (the default). Its value, when defined, is 1. |
_ 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. TypeCL /?At the command line to see the major and minor versions of your compiler along with the build number. |
_ Msvc_runtime_checks |
Defined when one of /RTC compiler options is specified. |
_ Mt |
Defined when /MD or/MDD (multithreaded DLL) or /Mt or/MTD (multithreaded) is specified. |
_ Native_wchar_t_defined |
Defined when /ZC: wchar_t is used. |
_ OpenMP |
Defined when compiling with/OpenMP, returns an integer representing the date of the OpenMP specification implemented by Visual C ++. // _OPENMP_dir.cpp// compile with: /openmp #include <stdio.h> int main() { printf("%d\n", _OPENMP);} |
_ Vc_nodefaultlib |
Defined when/ZLIs used; see/ZL (omit default library name) for more information. |
_ Wchar_t_defined |
Defined when /ZC: wchar_t is used or if wchar_t is defined in a system header file encoded in your project. |
_ Win32 |
Defined for applications for Win32 and win64. always defined. |
_ Win64 |
Defined for applications for win64. |
_ Wp64 |
Defined when specifying /Wp64. |