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 |
---|---|
![]() ![]() |
Set to the integer 1. Indicates the product is a 32-bit compiler. |
![]() ![]() |
Defined when compiling 64 bit programs. |
![]() |
Indicates that the operating system is AIX. |
![]() |
Indicates that the operating system is AIX version 3.2 or higher. |
![]() |
Indicates that the operating system is AIX version 4.1 or higher. |
![]() |
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). |
![]() |
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. |
![]() |
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). |
![]() ![]() |
Indicates DBCS support is enabled. Defined using the /Sn compiler option. |
![]() ![]() |
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__ | |
![]() ![]() |
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). |
![]() ![]() |
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. |
![]() |
Indicates that the host operating system is AIX. |
![]() |
Indicates that the host operating system is OS/2. |
![]() |
Indicates that the host operating system is Windows. |
![]() |
Indicates the version number of the C compiler. __IBMC__ = 430. This macro should be used in new code. |
![]() |
Indicates the version number of the C++ compiler. __IBMCPP__ = 360. This macro should be used in new code. |
![]() ![]() |
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. |
![]() ![]() ![]() |
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. |
![]() ![]() |
Indicates code is being compiled for a 386 chip or higher. |
![]() ![]() |
Indicates code is being compiled for a 386 chip or higher. |
![]() |
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. |
![]() ![]() |
Indicates multithread code is being generated. Defined using the /Gm compiler option. |
![]() ![]() |
Indicates that information about default libraries will not be included in object files. Defined using the /Gn option. |
![]() |
Set to the integer 1. Indicates the product is an OS/2 compiler. |
![]() |
Indicates that the operating system is AIX version 4.1 or higher |
![]() |
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). |
![]() |
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). |
![]() ![]() |
Indicates the subsystem libraries are being used. Defined using the /Rn compiler option. |
![]() |
Indicates that the compiler supports __stdcall linkage. |
![]() |
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. |
![]() ![]() |
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. |
![]() |
Indicates that the compiler generates Win32 code. |
![]() |
Set to the integer 1. Indicates the product is a Windows compiler. |
![]() |
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 Has a value of 0x0306 for C++, and 0x0403 for C. |
ISO/ANSI Standard Predefined Macro
Names