ANSI compliant predefined macros:
_ Date __
: Indicates the date when the current source file is compiled. Format: Month/day/year (MMM dd yyyy ).
_ File __
: Name of the source file being processed.
_ Line __
: Indicates the row of the source file being processed. You can use the # Line command to modify it.
_ Stdc __
: Stands for the ansi c standard. It is defined as a constant integer 1 only when/Za is specified in the compiler option and is not compiled into a C ++ program; otherwise, it is not defined.
_ Time __
: Indicates the time when the source file was last compiled. Format: hour/minute/second (HH: mm: SS ).
_ Timestamp __
: Indicates the date and time when the source file was last modified. Format: DDD Mmm dd hh: mm: ss yyyy. Here, DDD is the abbreviation of the week.
: Defines the ATL version.
: Set the default char type to unsigned. It is defined only when the compiler option/J is specified.
: Specifies the version of the Common Language Runtime (CLR) during application compilation. The format is mmmbbbbb, where M is the main version of CLR, mm is the next version of CLR, and bbbbb is the build number.
: Defined only when/CLR,/CLR: pure or/CLR: Safe is used for compilation. The value of _ cplusplus_cli is 200406.
_ Counter __
: An integer starting from 0. Each time it appears, the value increases by 1. You can use _ counter _ as the prefix to generate a unique name.
It is defined only when a C ++ program is compiled. It is generally used to distinguish between a C program and a C ++ program.
: If the program contains any header file of the C ++ standard library, _ cpplib_ver is defined. Displays the version of the header file in use.
: Used to identify whether the compiler specifies rtti. If/GR is set in the compiler option (enable the runtime type information mechanism-rtti), _ cpprtti is defined.
: Used to identify whether the compiler enables exception handling. If/GX is set in the compiler option, _ cpprtti is defined.
: Used to identify the debug mode. It is defined only when the compiler specifies/LDD,/MDD or/MTD.
: This parameter is defined only when/MD or/MDD (multithread DLL) is specified in the compiler option.
_ Funcdname __
: Valid only within the function. Returns the name of the function modified by the compiler. If/EP or/P is set in the compiler option, _ funcdname _ is not defined.
_ Funcsig __
: It is valid only within the function and returns the signature of the function. A function signature consists of the function name, parameter list, return type, and included namespace. If it is a member function, its class name and const/volatile qualifier will also be part of the signature. In a 64-bit operating system, __cdecl is the default function call method. If/EP or/P is set in the compiler options, _ funcsig _ is not defined.
_ Function __
: Valid only within the function. Returns the unmodified name of the function. If/EP or/P is set in the compiler option, _ function _ is undefined.
: Indicates the maximum bits of the integer type ).
: Defined for the DEC Alpha platform. (Not supported now)
: It is defined when any form of/CLR (/CLR: oldsyntax, for example,/CLR: Safe) is used for compilation.
: Defined when/CLR: Pure is used for compilation.
: Defined when/CLR: Safe is used for compilation.
: Defines the x86 processor architecture. If the value is 300, the value is 80386. If the value is 400, the value is 80486.
: Defined for the itanium Processor family's 64-bit processor (IA64) architecture.
: Indicates the value of the compiler option/arch. 0:/arch not specified; 1: specified/arch: SSE; 2: specified/arch: sse2
: Defined for the Power Macintosh platform. (Not supported now)
: Defined for the MIPs platform. (Not supported now)
: Defined for the PowerPC platform. (Not supported now)
: Defines the x64 processor architecture.
: Defined when the compiler option specifies/CLR, its value is 1.
: Specify the MFC version. For example, 0x0700 indicates MFC version 7.
: Indicates the revision number of the compiler version number. The revision number is the fourth part of the version number separated by periods. For example, if the version of the VC ++ compiler is 15.00.20706.01, the value of _ msc_build is 1.
: It is defined when the compiler option/ze (default) is specified, and its value is 1.
: Indicates the main, minor version, and build number of the compiler. The main version number is the first part of the entire version number, the minor version number is the second part of the entire version number, and the build number is the third part of the entire version number. For example, if the version of the VC ++ compiler is 15.00.20706.01, the value of _ msc_full_ver is 150020706. You can type CL in the command line.
/? To view the version number of the compiler.
: Indicates the main version number of the compiler. For example, if the version of the VC ++ compiler is 15.00.20706.01, the value of _ msc_ver is 1500.
: Defined when one of the compiler options/RTC (/RTCs or/rtcu or/rtc1) is specified.
: Defined when the compiler options/MD or/MDD (multithreaded DLL) or/Mt or/MTD (multithreaded) are specified.
: It is defined when the compiler option/ZC: wchar_t is specified (wchar_t is considered as a built-in type.
: If a compiler option or OpenMP is specified, an integer representing the date of OpenMP in Visual C ++ is returned.
: It is defined when the compiler option/ZL is specified (the default library name is ignored.
: Wchar_t is defined when the compiler option/ZC: wchar_t is specified or the system header file contained in the project is defined.
: Defined for Win32 and win64 applications. There is always a definition.
: Defined for win64 applications.
: Defined when the compiler option/wp64 is specified.