Defining Macros

You can use the -A and -D options to define the assertion and macro names to be used during preprocessing. The -U option directs the preprocessor to suppress an automatic definition of a macro.

Use the -A option to make an assertion. This option performs the same function as the #assert preprocessor directive. The form of this option is:

-Aname[(value)]

Argument  Description
name indicates an identifier for the assertion
value  

indicates a value  for the assertion. If a value  is specified, it should be quoted, along with the parentheses delimiting it.

For example, to make an assertion for the identifier fruit with the value orange,banana use the following command:

The compiler provides a number of predefined macros. For a list of predefined macros available to the Intel® C++ Compiler, see the Predefined Macros table below.

Enter -A- to suppress all predefined macros, except for those beginning with the double underscore.

Use the -D option to define a macro. This option performs the same function as the #define preprocessor directive. The form of this option is:

-Dname[{=|#}value]

Argument  Description
name The name of the macro to define.
value Indicates a value to be substituted for name. If you do not enter a value, name is set to 1. The value should be quoted if it contains non-alphanumerics.

For example, to define a macro called SIZE with the value 100 use the following command:

Use the -Uname option to suppress any automatic definition for the specified name. The -U option performs the same function as a #undef preprocessor directive. It can be used to undefine any macro, in addition to the predefined onces.

For more details about preprocessor directives, see a language reference such as C: A Reference Manual.

Predefined Macros

The predefined macros available for the Intel C++ Compiler compilations targeted for IA-32- and Itanium(TM)-based systems are described in the tables below. The Default column describes whether the macro is enabled (ON) or disabled (OFF) by default. The Disable column lists the option that disables the macro; no indicates that the macro cannot be disabled.

Predefined Macros for Compilations Targeted for IA-32 Systems

Macro Name Default Disable Description / When Used
__INTEL_COMPILER=n n=500 no Defines the compiler version. Defined as 500 for the Intel C++ Compiler V5.0. Always defined.
__ICC=n n=500 no Enables the Intel C++ Compiler. Assigned value refers to version of the compiler (e.g., 500 is 5.00). Supported for legacy reasons. Use __INTEL_COMPILER instead.
__cplusplus C++ only no Defined when compiling C++ source.
_M_IX86=n ON, n=600 -U defined based on the processor option you specify:
n
=500 if you specify the -G5 option
n
=600 if you specify the -GB or -G6 option
n
=700 if you specify the -G7 option
_DLL OFF -U defined if you specify the -MD option
_MT OFF -U defined if you specify the -MD, -MT, or -LD option
_CHAR_UNSIGNED OFF -U defined if you specify the -J option
_CPPRTTI OFF -U defined if you specify the -GR option for C++ only
_CPPUNWIND OFF -U defined if you specify the -GX option for C++ only

Predefined Macros for Compilations Targeted for Itanium(TM)-based Systems

Macro Name Default Disable Description / When Used
__INTEL_COMPILER=n n=500 no Defines the compiler version. Defined as 500 for the Intel C++ Compiler V5.0. Always defined.
__ECC=n n=500 no Enables the Intel C++ Compiler. Assigned value refers to version of the compiler (e.g., 500 is 5.00). Supported for legacy reasons. Use __INTEL_COMPILER instead.
__cplusplus C++ only no Enables compilation of C++ source.
_INTEGRAL_MAX_BITS=n n=64 -U Indicates support for the __int64 type.
_DLL OFF -U Compile and link with the multi-thread run-time library to produce a DLL. This macro is enabled if you specify -MD, -MT, or -LD.
_MT OFF -U Compile and link with the C version of the multi-thread run-time library. This macro is enabled if you specify -MD.
_CHAR_UNSIGNED OFF -U Makes the default character type unsigned. This macro is enabled if you specify the -J option.
_CPPUNWIND OFF -U Enables C++ exception handling. This macro is enabled if you specify the -GX option.
_CPPRTTI OFF -U Enables run-time type information. This macro is enabled when you specify -GR.
_M_IA64 ON -U Enables compilations targeted for Itanium(TM)-based systems
_M_IA64=n n=64100 -U Indicates the value for the preprocessor identifier to reflect the Itanium(TM) architecture.