Macros indicating the XL C/C++ compiler product

Macros related to the XL C/C++ compiler are always predefined, and are protected (the compiler issues a warning if you try to undefine or redefine them). You can use the -qshowmacros=pre -E compiler options to view the values of the predefined macros.

Table 1. Compiler product predefined macros
Predefined macro name Description Predefined value
C only __IBMC__ Indicates the level of the XL C compiler. An integer in the format VRM, where :
V
Represents the version number
R
Represents the release number
M
Represents the modification number
C++ only __IBMCPP__ Indicates the level of the XL C++ compiler. An integer in the format VRM, where :
V
Represents the version number
R
Represents the release number
M
Represents the modification number
C only. __xlc__ Indicates the level of the XL C compiler. A string in the format "V.R.M.F", where:
V
Represents the version number
R
Represents the release number
M
Represents the modification number
F
Represents the fix level
__xlC__ Indicates the VR level of the XL C and XL C++ compilers in hexadecimal format. Using the XL C compiler also automatically defines this macro. A four-digit hexadecimal integer in the format 0xVVRR, where:
V
Represents the version number
R
Represents the release number
__xlC_ver__ Indicates the MF level of the XL C and XL C++ compilers in hexadecimal format. Using the XL C compiler also automatically defines this macro. A eight-digit hexadecimal integer in the format 0x0000MMFF, where:
M
Represents the modification number
F
Represents the fix level

For example, in XL C/C++ V12.1, PTF 10.1.0.3, the value of the macro is 0x00000003.