Macro |
Description |
_atl_ver |
Defines the ATL version. |
_char_unsigned |
The Default char type 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'll is in the following format: mmmbbbbb Where, Span class= "parameter" >m is the major version of the runtime. mm is the minor version of the runtime. bbbbb is the build number.
|
copy Code |
//Clr_ver.cpp //compile with:/clr using namespace System;
Int main () { Console::WriteLine (__clr_ver); } |
|
__cplusplus_cli |
Defined when compiling with/ CLR, /clr:pure, or /clr:safe. Value of __cplusplus_cli is 200406. __CPLUSPLUS_CLI is in effect throughout the translation unit.
|
Copy Code |
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's used in a compiland. __counter__ remembers its state when using precompiled headers. If the last __counter__ value is 4 after building a precompiled header (PCH), it'll start with 5 on each PCH u Se. __counter__ lets you generate unique variable names. You can use the token pasting with a prefix to make a unique name. For example:
|
Copy Code |
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 WITH/GR (Enable run-time Type information). |
_cppunwind |
Defined for code compiled WITH/GX (Enable Exception handling). |
_debug |
Defined when compiling with/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 the/epor/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 the/ep or/p compiler option. On a 64-bit operating system, the calling convention are __cdecl by 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 the/ep or/p compiler option. |
_integral_max_bits |
Reports the maximum size (in bits) for a integral type.
|
Copy Code |
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 so uses any form of/ 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 /arch compiler option is 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 being 1 WHEN/CLR is specified. |
_mfc_ver |
Defines the MFC version. For example, 0x0700 represents MFC version 7. |
_msc_extensions |
This macro was defined when compiling with the/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 and a 1.0 point release. The Visual C + + 2005 Compiler version is 1400. Type cl/? 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 the THE/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 a integer representing the date of the OpenMP specification implemented by V Isual C + +.
|
Copy Code |
_openmp_dir.cpp
int main () { printf ("%d\n", _OPENMP); } |
|
_vc_nodefaultlib |
Defined when /zl is used; See/zl (Omit Default Library Name) for more information. |
_wchar_t_defined |
Defined when/zc:wchar_t is used or if wchar_t are 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. |
_wp64 |
Defined when Specifying/wp64. |