Microsoft-specific
Note:Both the 16-bit and 32-bit compilers support these macros.
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.
The following symbols are added to C/C ++ 7.0:
Macro Specifies -------------------------------------------------------------------- __cplusplus Macro defined when compiling a C++ program. (This macro is not defined for the C compiler.)
Microsoft-specific
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.
The following symbols are added to 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-bit special
The following symbols are added to Visual C ++ and 32-bit version 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.
The following symbols added to Visual C ++, 32-bit version 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 Macro will have one of the following values depending on a specific Microsoft Compiler:
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
NotesIf the predefined identifier has two forms of use and does not use underscores, the command line driver defines two options if/Ze is specified (for Microsoft extension compilation ). If you specify the/za option (compiling ANSI compatibility), it defines only the leading underline form.