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.

Note

Available only for compilations targeting 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.

Note

Available only for compilations targeting Intel® 64 architecture.

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

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Byte and Word instructions.

It is also defined as '1' when option [Q]xCORE-AVX512 or higher processor-targeting options are specified.

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

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Conflict Detection instructions.

It is also defined as '1' when option [Q]xCORE-AVX512, [Q]xCOMMON-AVX512, [Q]xMIC-AVX512 or higher processor-targeting options are specified.

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

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Doubleword and Quadword instructions.

It is also defined as '1' when option [Q]xCORE-AVX512 or higher processor-targeting options are specified.

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

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Exponential and Reciprocal instructions.

It is also defined as '1' when option [Q]xMIC-AVX512 or higher processor-targeting options are specified.

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

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Foundation instructions.

It is also defined as '1' when option [Q]xCORE-AVX512, [Q]xCOMMON-AVX512, [Q]xMIC-AVX512 or higher processor-targeting options are specified.

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

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Prefetch instructions.

It is also defined as when option [Q]xMIC-AVX512 or higher processor-targeting options are specified.

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

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Vector Length extensions.

It is also defined as '1' when option [Q]xCORE-AVX512 or higher processor-targeting options are specified.

__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 option fno-exceptions is not used.

__extension__ (Linux*)

 

__gnu_linux__ (Linux*)

1

__GFX__ (Windows*, Linux*)

You can use this macro to protect code that should only be compiled for and executed on Intel® Graphics Technology.

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 [Q]offload option.

__GNUC__ (Linux*)

The major version number of gcc* installed on the system.

__GNUC_MINOR__ (Linux*)

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

__GNUC_PATCHLEVEL__ (Linux*)

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

__GNUG__ (Linux*)

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

__GXX_ABI_VERSION (Linux*)

102 (Linux*)

__HONOR_STD (Linux*, OS X*)

1

__i386 (Linux*, OS X*)

__i386__ (Linux*, OS X*)

i386 (Linux*, OS X*)

1

Note

Available only for compilations targeting IA-32 architecture.

>__INTEL_COMPILER (Linux*, OS X*)

__ICC (Linux*, OS X*)

__ICL (Windows*)

Intel® C++ Compiler version

Note

This macro may be affected by command line compiler options, such as /Qicl- or -no-icc

__INTEL_CLANG_COMPILER (OS X*)

Guards code to be compiled exclusively with clang-compatible Intel® C++ Compiler.

__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 to '1'.

Equal to the same value n as specified by [Q]ms[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 option fno-rtti is not specified.

__INTEL_STRICT_ANSI__ (Linux*, OS X*)

Defined as '1' when option 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*)

__linux__ (Linux*)

linux (Linux*)

1

__LITTLE_ENDIAN__ (OS X*)

1

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

80 (Linux*, OS X*)

64, 80 with option [Q]long-double (Windows*)

__LONG_DOUBLE_64__ (Linux*)

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

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

__LONG_MAX__ (Linux*)

9223372036854775807L

Note

Available only for compilations targeting Intel® 64 architecture.

__LP64__ (Linux*)

1

Note

Available only for compilations targeting 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

__NO_INLINE__ (Linux*, OS X*)

__NO_MATH_INLINES (Linux*, OS X*)

__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*)

__pentium4__ (Linux*, OS X*)

1

__PIC__ (Linux*, OS X*)

__pic__ (Linux*)

1 (OS X*)

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

__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 to '1' 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 to '1' 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

__USER_LABEL_PREFIX__ (Linux*, OS X*)

 

__VERSION__ (Linux*, OS X*)

Intel® C++ Compiler 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*)

__x86_64__ (Linux*, OS X*)

1

Note

Available only for compilations targeting Intel® 64 architecture.

_BOOL (Linux*)

1

_INC_STDIO (Windows*)

Defined, no value.

_INTEGRAL_MAX_BITS (Windows*)

64

_LP64 (Linux*)

1

Note

Available only for compilations targeting Intel® 64 architecture.

_M_AMD64 (Windows*)

1

Note

Available only for compilations targeting Intel® 64 architecture.

_M_IX86 (Windows*)

700

_M_X64 (Windows*)

1

Note

Available only for compilations targeting Intel® 64 architecture.

_MSC_EXTENSIONS (Windows*)

1

_MSC_FULL_VER (Windows*)

Equal to Visual C++* version used.

190022609 - Visual C++* 2015

1800210051 - Visual C++* 2013

170061030 - Visual C++* 2012

160040219 - Visual C++* 2010

_MSC_VER (Windows*)

1900 (Visual C++* 2015)

1800 (Visual C++* 2013)

1700 (Visual C++* 2012)

1600 (Visual C++* 2010)

_MT (Windows*, Linux*)

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

1 (Linux*)

Note

On Linux*, available only for compilations targeting Intel® 64 architecture.

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

200805 when you specify option [Q]openmp.

_PGO_INSTRUMENT (Windows*, Linux*)

'1' when options [Q]cov-gen or [Q]prof-gen are specified.

_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 "wctype_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'.

Note

Available only for compilations targeting Intel® 64 architecture.

unix (Linux*)

__unix (Linux*)

__unix__ (Linux*)

1

See Also

For more complete information about compiler optimizations, see our Optimization Notice.