Additional IBM C and C++ Compilers Predefined Macros

The macros identified in this section are provided to allow customers to write programs that use IBM C and C++ Compilers services. Only those macros identified in this section should be used to request or receive IBM C and C++ Compilers services. These macros are in addition to the ANSI predefined macros.

The macros offered by the IBM C and C++ Compilers are:

Macro Description
__32BIT__ Set to the integer 1. Indicates the product is a 32-bit compiler.
__64BIT__ Defined when compiling 64 bit programs.
_AIX Indicates that the operating system is AIX.
_AIX32 Indicates that the operating system is AIX version 3.2 or higher.
_AIX41 Indicates that the operating system is AIX version 4.1 or higher.
_AIX43 Indicates that the operating system is AIX version 4.3 or higher.
__ANSI__ Allows only language constructs that conform to ISO/ANSI C standard. Defined using the #pragma langlvl directive or /Sa option (Intel). On AIX, the compiler option is -qlanglvl=(ansi).
_ARCH_* Indicates that the compiler generates code to run on the processor or family of processors denoted by the wildcard (*). E.g.: _ARCH_PENTIUM2, _ARCH_PWR. Use the -qarch compiler option.
_CHAR_SIGNED Indicates default character type is signed. Defined when the #pragma chars(signed) directive is in effect, or when the /J- compiler option (Intel) is set. Use the -qchar=signed option on AIX.
_CHAR_UNSIGNED Indicates default character type is unsigned. Defined when the #pragma chars(unsigned) directive is in effect, or when the /J+ compiler option (Intel) is set. Use the -qchar=unsigned option on AIX.
__COMPAT__ Indicates language constructs compatible with earlier versions of the C++ language are allowed. Defined using the #pragma langlvl(compat) directive or /Sc compiler option (Intel). On AIX, the compiler option is -qlanglvl=(compat).
__DBCS__ Indicates DBCS support is enabled. Defined using the /Sn compiler option.
__DDNAMES__ Indicates ddnames are supported. Defined using the /Sh compiler option.
__DEBUG_ALLOC__ Maps memory management functions to their debug versions. Defined using the /Tm compiler option (Intel).
__DIGRAPHS__  
__DLL__ or _DLL Indicates code for a DLL is being compiled. Defined using the /Ge- compiler option.
__EXTENDED__ Allows additional language constructs provided by the IBM C and C++ Compilers implementation. Defined using the #pragma langlvl directive or /S2 option (Intel). On AIX, the compiler option is -qlanglvl=(extended).
_FP_INLINE_ Generates inline instructions for the following floating-point library functions, as defined in math.h, when targetting an Intel processor: fcos(), fsin(), fptan(), facos(), fasin(), fpatan(), and fsqrt().
__FUNCTION__ Indicates the name of the function currently being compiled. For C++ programs, expands to the actual function prototype.
__HHW_INTEL__ Indicates that the host hardware is an Intel processor.
__HHW_RS6000__ Indicates that the host hardware is an RISC 6000 processor.
__HOS_AIX__ Indicates that the host operating system is AIX.
__HOS_OS2__ Indicates that the host operating system is OS/2.
__HOS_WIN__ Indicates that the host operating system is Windows.
__IBMC__ Indicates the version number of the C compiler. __IBMC__ = 430. This macro should be used in new code.
__IBMCPP__ Indicates the version number of the C++ compiler. __IBMCPP__ = 360. This macro should be used in new code.
__IMPORTLIB__ Indicates that dynamic linking is used. Defined using the /Gd option.
_LONG_LONG Macro defined when the compiler is in a mode that permits long long int and unsigned long long int types.
__LONGDOUBLE128
__LONGDOUBLE80
Sets the number of bits to use when representing the value of a long double. Under AIX, the available options are 128 and 64 bits. Under OS/2 and Windows, the available options are 80 and 64 bits.
_M_I386 Indicates code is being compiled for a 386 chip or higher.
_M_IX86 Indicates code is being compiled for a 386 chip or higher.
__MATH__ Instructs the compiler to generate substitute code for calls to some math functions available in the standard C runtime libraries, if appropriate. The functions handled this way are defined as replacement text for macros that begin with two underscores (__) in the math.h header file.
__MULTI__ or _MT Indicates multithread code is being generated. Defined using the /Gm compiler option.
__NO_DEFAULT_LIBS__ Indicates that information about default libraries will not be included in object files. Defined using the /Gn option.
__OS2__ Set to the integer 1. Indicates the product is an OS/2 compiler.
_POWER Indicates that the operating system is AIX version 4.1 or higher
__SAA__ Allows only language constructs that conform to the most recent level of SAA C standards. Defined using the #pragma langlvl directive or /S2 option (Intel). On AIX, the compiler option is -qlanglvl=(saa).
__SAAL2__ Allows only language constructs that conform to SAA Level 2 C standards. Defined using the #pragma langlvldirective or /S2 option (Intel). On AIX, the compiler option is -qlanglvl=(saal2).
__SPC__ Indicates the subsystem libraries are being used. Defined using the /Rn compiler option.
_STDCALL_SUPPORTED Indicates that the compiler supports __stdcall linkage.
__STR__ Instructs the compiler to generate substitute code for calls to some string functions available in the standard C runtime libraries, if appropriate. The functions handled this way are defined as replacement text for macros that begin with two underscores (__) in the string.h header file.
__TEMPINC__ Indicates the template-implementation file method of resolving template functions is being used. Defined using the /Ft compiler option (Intel).
__THW_INTEL__ Indicates that the target hardware is an Intel processor.
__THW_RS6000__ Indicates that the target hardware is a RISC 6000 processor.
__TILED__ Indicates tiled memory is being used. Defined using the /Gt compiler option.
__TOS_AIX__ Indicates that the target operating system is AIX.
__TOS_OS2__ Indicates that the target operating system is OS/2.
__TOS_WIN__ Indicates that the target operating system is Windows.
_WIN32 Indicates that the compiler generates Win32 code.
__WINDOWS__ Set to the integer 1. Indicates the product is a Windows compiler.
__xlC__ Use the __IBMC__ and __IBMCPP__ macros instead.

Indicates a hexadecimal constant with the version and release number of the compiler. Is in the form:

0xVVRR

where:

VV represents the compiler version number
RR represents the compiler release number

Has a value of 0x0306 for C++, and 0x0403 for C.



ISO/ANSI Standard Predefined Macro Names