User and Reference Guide for the Intel® C++ Compiler 14.0

Additional Predefined Macros

The Intel® C++ Compiler supports the predefined macros listed in the table below. The compiler also includes predefined macros specified by the ISO/ANSI standard.

Unless otherwise stated, the macros are supported on systems based on IA-32 and Intel® 64 architectures.

Macro

Description

__APPLE__ (OS X*)

1

__APPLE_CC__ (OS X*)

gcc build number

__ARRAY_OPERATORS (Linux*)

1

__AVX__ (Windows*, Linux*)

Defined and value to 1 with arch:AVX (Windows*) or march=corei7-avx or mavx (Linux*), or [Q]xAVX or higher processor targeting options.

Available only on systems based on Intel® 64 architecture.

__AVX2__ (Windows*, Linux*)

Defined and value to 1 with arch:CORE-AVX2 (Windows*) or march=core-avx2 (Linux*), or [Q]xCORE-AVX2 or higher processor targeting options.

Available only on systems based on Intel® 64 architecture.

__BASE_FILE__ (Linux*)

Name of source file

__cilk (Windows*, Linux*)

200; however, if you specify [Q]cilk-serialize or the negative form of [Q]intel-extensions, the value is undefined.

__COUNTER__ (Windows*)

0

__cplusplus (Linux*)

1 (with C++ compiler)

__DEPRECATED (Linux*)

1

__DYNAMIC__ (OS X*)

1

__EDG__ (Windows*, Linux*, OS X*)

1

__EDG_VERSION__ (Windows*, Linux*, OS X*)

EDG version

__ELF__ (Linux*)

1

__EXCEPTIONS (Linux*)

Defined as 1 when fno-exceptions is not used.

__extension__ (Linux*)

 

__gnu_linux__ (Linux*)

1

__GFX__ (Windows*)

You can use this macro to protect code that should only be compiled for and executed on the target.

Defined by default. Builds code that runs on the CPU and the target, but this macro is only defined during the target compilation. Undefined when you use the negative form of the Qoffload option.

__GNUC__ (Linux*, OS X*)

The major version number of gcc installed on the system.

__GNUC_MINOR__ (Linux*, OS X*)

The minor version number of gcc or g++ installed on the system.

__GNUC_PATCHLEVEL__ (Linux*, OS X*)

The patch level version number of gcc or g++ installed on the system.

__GNUG__ (Linux*, OS X*)

The major version number of g++ installed on the system.

__GXX_ABI_VERSION (Linux*, OS X*)

102 (Linux*)

ABI version (OS X*)

__HONOR_STD (Linux*, OS X*)

1

__i386 (Linux*, OS X*)

1

Available only on systems based on IA-32 architecture.

__i386__ (Linux*, OS X*)

1

Available only on systems based on IA-32 architecture.

i386 (Linux*, OS X*)

1

Available only on systems based on IA-32 architecture.

__ICC (Linux*, OS X*)

Intel compiler version

__ICL (Windows*)

Intel compiler version

__INTEL_COMPILER (Linux*, OS X*)

Intel compiler version

__INTEL_COMPILER_BUILD_DATE (Windows*, Linux*, OS X*)

YYYYMMDD

__INTEL_CXX11_MODE__ (Windows*, Linux*)

Enables C++11 experimental support for C++ programs.

Defined as 1 when [Q]std=c++11 is specified.

__INTEL_COMPILER_UPDATE

Returns the current minor update number of the Intel® C++ Compiler, starting at 0. (Windows*, Linux*, OS X*)

You can use this macro to differentiate between compiler updates when you have multiple updates of the Intel® C++ Compiler installed concurrently.

Example: Intel® C++ Compiler version XX.0.2, the macro would preprocess to “2”.

__INTEL_MS_COMPAT_LEVEL (Windows*)

Default to1

Equal to the same value n as specified by Qms[n]

__INTEL_OFFLOAD

This macro is defined by the compiler when building code to run on the CPU and on the coprocessor. (Windows*, Linux*)

You can use this macro in conjunction with the negative form of the [Q]offload compiler option, or the Qmic (Windows*) or mmic (Linux*) compiler option to protect code on the host that should only be executed for an offload build, such as calls to the omp_set_num_threads_target family of APIs in offload.h.

Defined by default. Builds code that runs on the CPU and the coprocessor. Undefined when you use the negative form of the [Q]offload compiler option, or the Qmic (Windows*) or mmic (Linux*) compiler option.

__INTEL_RTTI__ (Linux*, OS X*)

Defined as 1 when fno-rtti is not specified.

__INTEL_STRICT_ANSI__ (Linux*, OS X*)

Defined as 1 when strict-ansi is specified.

__KNC__

This macro is similar to __MIC__, but it is defined by the compiler while building code to run on the variant of the Intel® MIC Architecture known as the Intel® Xeon Phi™ coprocessor. (Windows*, Linux*)

__linux (Linux*)

1

__linux__ (Linux*)

1

__LITTLE_ENDIAN__ (OS X*)

1

__LONG_DOUBLE_SIZE__ (Windows*, Linux*, OS X*)

80 (Linux*, OS X*)

64 (Windows*)

80 with /Qlong-double (Windows*)

__LONG_DOUBLE_64__ (Linux*)

When this macro is defined, the long double type is 64-bits.

Defined when you use the compiler option mlong-double with 64 as an argument.

__LONG_MAX__ (Linux*)

9223372036854775807L

Available only on systems based on Intel® 64 architecture.

__LP64__ (Linux*)

1

Available only on systems based on Intel® 64 architecture.

__MACH__ (OS X*)

1

__MIC__

This macro is defined by the compiler while building code to run on the coprocessor. (Windows*, Linux*)

You can use this macro to protect code that should only be compiled for and executed on the coprocessor, such as intrinsic functions that only run on Intel® MIC Architecture, or the corresponding header files, such as zmmintrin.h.

Defined by default. Builds code that runs on the CPU and the coprocessor, but this macro is only defined during the coprocessor compilation. Undefined when you use the negative form of the [Q]offload option.

To build code that runs only on the coprocessor, use the Qmic (Windows*) or mmic (Linux*) compiler option.

This macro is defined when you use Qmic (Windows*) or mmic (Linux*).

__MMX__ (Linux*, OS X*)

1

On Linux*, available only on systems based on Intel® 64 architecture.

__NO_INLINE__ (Linux*, OS X*)

1

__NO_MATH_INLINES (Linux*, OS X*)

1

__NO_STRING_INLINES (Linux*, OS X*)

1

OFFLOAD_STATUS_INIT(statusvarname )

Initializes the variable for the status clause in an offload pragma to a known value before offloading code. (Windows*, Linux*)

After the offload, you can examine statusvarname to check if the pragma was executed at all, whether the offload succeeded or failed, and, if relevant, why it failed.

See offload.

__OPTIMIZE__ (Linux*, OS X*)

1

__pentium4 (Linux*, OS X*)

1

__pentium4__ (Linux*, OS X*)

1

__PIC__ (Linux*, OS X*)

1 (OS X*)

Defined as 1 when fPIC is specified. (Linux*)

__pic__ (Linux*)

Defined as 1 when fPIC is specified.

__PTRDIFF_TYPE__ (Linux*, OS X*)

int on IA-32 architecture; long on Intel® 64 architecture (Linux*)

int / long (OS X*)

__QMSPP_ (Windows*, OS X*)

1

__REGISTER_PREFIX__ (Linux*, OS X*)

 

__SIGNED_CHARS__ (Windows*, Linux*, OS X*)

1

__SIZE_TYPE__ (Linux*, OS X*)

unsigned on IA-32 architecture; unsigned long on Intel® 64 architecture (Linux*)

unsigned long (OS X*)

__SSE__ (Windows*, Linux*, OS X*)

Defined as 1 for processors that support SSE instructions. (Linux* and OS X*)

Defined and value to 1

Only undefined when arch:IA32 (Windows*)

__SSE2__ (Windows*, Linux*, OS X*)

Defined as 1 for processors that support Intel® SSE2 instructions. (Linux* and OS X*)

Defined and value to1 by default or with arch:SSE2, QxSSE2, QaxSSE2 or higher processor targeting options (Windows*)

__SSE3__ (Windows*, Linux*, OS X*)

Defined as 1 for processors that support Intel® SSE3 instructions. (Linux* and OS X*)

Defined and value to1 with arch:SSE3, QxSSE3 or higher processor targeting options. (Windows*)

__SSE4_1__ (Windows*, Linux*)

Defined as 1 for processors that support Intel® SSE4 instructions. (Linux*)

Defined and value to 1 with arch:SSE4.1, /QxSSE4.1 or higher processor targeting options (Windows*)

__SSE4_2__ (Windows*, Linux*)

Defined as 1 for processors that support SSSE4 instructions. (Linux*)

Defined and value to 1 with arch:SSE4.2, QxSSE4.2 or higher processor targeting options (Windows*)

__SSSE3__ (Windows*, Linux*, OS X*)

Defined as 1 for processors that support SSSE3 instructions. (Linux* and OS X*)

Defined and value to 1 with arch:SSSE3, QxSSSE3 or higher processor targeting options (Windows*)

__STDC__ (OS X*)

1

__STDC_HOSTED__ (OS X*)

1

__unix (Linux*)

1

__unix__ (Linux*)

1

__USER_LABEL_PREFIX__ (Linux*, OS X*)

 

__VERSION__

(Linux*, OS X*)

Intel version string

__w64 (Windows*)

Defined, no value

__WCHAR_MAX__ (OS X*)

2147483647

__WCHAR_T (Linux*)

1

__WCHAR_TYPE__ (Linux*, OS X*)

long int on IA-32 architecture; int on Intel® 64 architecture (Linux*)

long int (OS X*)

__WINT_TYPE__ (Linux*, OS X*)

unsigned int

__x86_64 (Linux*, OS X*)

1

Available only on systems based on Intel® 64 architecture.

__x86_64__ (Linux*, OS X*)

1

Available only on systems based on Intel® 64 architecture.

_BOOL (Linux*)

1

_INC_STDIO (Windows*)

Defined, no value

_INTEGRAL_MAX_BITS (Windows*)

64

_LP64 (Linux*)

1

Available only on systems based on Intel® 64 architecture.

_M_AMD64 (Windows*)

1

Available only on systems based on Intel® 64 architecture.

_M_IX86 (Windows*)

700

_M_X64 (Windows*)

1

Available only on systems based on Intel® 64 architecture.

_MSC_EXTENSIONS (Windows*)

1

_MSC_FULL_VER (Windows*)

Equal to Visual C++ version used:

150021022 - Visual C++ 2008

160040219 - Visual C++ 2010

_MSC_VER (Windows*)

1500 if Visual C++ 2008* is used, 1600 if Visual C++ 2010* is used

_MT (Windows*, Linux*)

1 when multithreaded DLL or library is used (MD[d] or MT[d] specified) (Windows*)

1 (Linux*)

On Linux*, available only on systems based on Intel® 64 architecture.

_OPENMP (Windows*, Linux*, OS X*)

200805 when you specify [Q]openmp.

_PGO_INSTRUMENT (Windows*, Linux*)

1 when you specify [Q]cov-gen or [Q]prof-gen.

_PLACEMENT_DELETE (Linux*)

1

_SIZE_T_DEFINED (Windows*)

Defined, no value

_VA_LIST_DEFINED (Windows*)

Defined, no value

_WCHAR_T_DEFINED (Windows*)

Defined when Zc:wchar_t specified or "wchar_t" defined in header file

_WCTYPE_T_DEFINED (Windows*)

Defined when "wctype_t" defined in header file

_WIN32 (Windows*)

Defined and value to 1

_WIN64 (Windows*)

Defined and value to 1

Available only on systems based on Intel® 64 architecture.

linux (Linux*)

1

unix (Linux*)

1

See Also


Submit feedback on this help topic