ILE C/C++ Predefined Macros

Start of changeThe ILE C/C++ compiler provides the predefined macros described in this section. These macros are defined when their corresponding pragmas are invoked in program source, or when their corresponding compiler options are specified. Unless otherwise specified, macros when defined have a value of 1.

__ANSI__
Defined when the LANGLVL(*ANSI) compiler option is in effect. When this macro is defined, the compiler allows only language constructs that conform to the ANSI/ISO C and C++ standards.
__ASYNC_SIG__
C compiler only Defined when the SYSIFCOPT(*ASYNCSIGNAL) compiler option is in effect.

C++ compiler only Defined when TERASPACE(*YES *TSIFC) STGMDL(*TERASPACE) DTAMDL(*LLP64) RTBND(*LLP64) compiler options are in effect.

Start of change__BASE_FILE__End of change
Start of changeIndicates the fully qualified name of the primary source file.End of change
Start of change__BOOL__End of change
Start of change C++ compiler only Indicates that the bool keyword is accepted.End of change
_CHAR_SIGNED __CHAR_SIGNED__
Defined when the #pragma chars(signed) directive is in effect, or when the DFTCHAR compiler option is set to *SIGNED. If this macro is defined, the default character type is signed.
_CHAR_UNSIGNED __CHAR_UNSIGNED__
Start of changeDefined when the #pragma chars(unsigned) directive is in effect, or when the DFTCHAR compiler option is set to *UNSIGNED. If this macro is defined, indicates default character type is unsigned.End of change
__cplusplus98__interface__
Start of change C++ compiler only Defined when the LANGLVL(*ANSI) compiler option is specified.End of change
Start of change__C99_CPLUSCMTEnd of change
Start of change C compiler only Indicates support for C++ style comments. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__C99_COMPOUND_LITERALEnd of change
Start of change C++ compiler only Indicates support for compound literals. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__C99_FUNC__End of change
Start of change C++ compiler only Indicates support for the __func__ predefined identifier. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__C99_HEX_FLOAT_CONSTEnd of change
Start of change C++ compiler only Indicates support for hexadecimal floating constants. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__C99_MACRO_WITH_VA_ARGSEnd of change
Start of changeIndicates support for function-like macros with variable arguments. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__C99_PRAGMA_OPERATOREnd of change
Start of change C++ compiler only Indicates support for the _Pragma operator. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__C99_RESTRICTEnd of change
Start of change C++ compiler only Indicates support for the C99 restrict qualifier. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__C99_VARIABLE_LENGTH_ARRAYEnd of change
Start of change C++ compiler only Indicates support for variable length arrays. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__DIGRAPHS__End of change
Start of changeIndicates support for digraphs.End of change
__EXTENDED__
Defined only when the LANGLVL(*EXTENDED) compiler option is in effect. When this macro is defined, the compiler allows language extensions provided by the ILE C/C++ compiler implementation.
__FUNCTION__
Indicates the name of the function currently being compiled. For C++ programs, expands to the actual function prototype.
__HHW_AS400__
Indicates that the host hardware is an IBM® i processor.
__HOS_OS400__
C++ compiler only Indicates that the host operating system is i5/OS.
Start of change__IBMC__End of change
Start of change C compiler only Indicates the version of the C compiler. It returns an integer of the form VRM where:

V represents the version

R represents the release

M represents the modification level

For example, using the IBM i 7.1 compiler with the TGTRLS(*CURRENT) compiler option, __IBMC__ returns the integer value 710.

End of change
__IBMCPP__
Start of change C++ compiler only Indicates the version of the AIX® XL C++ compiler upon which the ILE C++ compiler is based. It returns an integer representing the compiler version. For example, using the IBM i 7.1 compiler with the TGTRLS(*CURRENT) compiler option, __IBMCPP__ returns the integer value 900. 900 means the ILE C++ compiler is based on the XL C++ V9.0 compiler.End of change
Start of change__IBM__ALIGNEnd of change
Start of change C++ compiler only Indicates support for the __align specifier.End of change
Start of change__IBM_ATTRIBUTESEnd of change
Start of change C++ compiler only Indicates support for type, variable, and function attributes. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__IBM_COMPUTED_GOTOEnd of change
Start of change C++ compiler only Indicates support for computed goto statements. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__IBM_DFP__End of change
Start of changeIndicates support for decimal floating-point types. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__IBM_EXTENSION_KEYWORDEnd of change
Start of change C++ compiler only Indicates support for the __extension__ keyword. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__IBM_INCLUDE_NEXTEnd of change
Start of changeIndicates support for the #include_next preprocessing directive.End of change
Start of change__IBM_LABEL_VALUEEnd of change
Start of change C++ compiler only Indicates support for labels as values. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__IBM_LOCAL_LABELEnd of change
Start of change C++ compiler only Indicates support for local labels. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__IBM_MACRO_WITH_VA_ARGSEnd of change
Start of change C++ compiler only Indicates support for variadic macro extensions. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__IBM_TYPEOF__End of change
Start of changeIndicates support for the __typeof__ or typeof keyword. This macro is always defined for C.

For C++, it is defined when the LANGLVL(*EXTENDED) compiler option is in effect.

End of change
__IFS_IO__
Start of changeDefined when the SYSIFCOPT(*IFSIO) or SYSIFCOPT(*IFS64IO) compiler option is specified.End of change
__IFS64_IO__
Start of changeDefined when the SYSIFCOPT(*IFS64IO) compiler option is specified. When this macro is defined, _LARGE_FILES and _LARGE_FILE_API are also defined in the relevant IBM-supplied header files.End of change
__ILEC400__
Start of change C compiler only Indicates that the ILE C compiler is being used.End of change
__ILEC400_TGTVRM__
Start of change C compiler only Same as the __OS400_TGTVRM__ macro.End of change
_LARGE_FILES
Defined when the SYSIFCOPT(*IFS64IO) compiler option is in effect and system header file types.h is included.
_LARGE_FILE_API
Defined when the SYSIFCOPT(*IFS64IO) compiler option is in effect and system header file types.h is included.
__LLP64_IFC__
Defined when the DTAMDL(*LLP64) compiler option is in effect.
__LLP64_RTBND__
C++ compiler only Defined when the RTBND(*LLP64) compiler option is in effect.
Start of change__LONGDOUBLE64End of change
Start of changeIndicates that the size of a long double type is 64 bits. This macro is always defined.End of change
Start of change_LONG_LONGEnd of change
Start of changeIndicates support for IBM long long data types. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.End of change
Start of change__NO_RTTI__End of change
Start of change C++ compiler only Defined when the OPTION(*NORTTI) compiler option is in effect.End of change
Start of change__OPTIMIZE__End of change
Start of change C++ compiler only Indicates the level of optimization in effect. The macro is undefined for OPTIMIZE(10). For other OPTIMIZE settings, the macro is defined as follows:

2 for OPTIMIZE(20)

3 for OPTIMIZE(30)

4 for OPTIMIZE(40)

End of change
__OS400__
This macro is always defined when the compiler is used with the i5/OS operating system.
__OS400_TGTVRM__
Start of changeDefines an integer value that maps to the version/release/modification level of the operating system that the generated object is intended to run on. For example, if the target release is set using the TGTRLS(V7R1M0) compiler option, this macro returns the integer value 710.End of change
__POSIX_LOCALE__
Start of changeDefined when the LOCALETYPE(*LOCALE) or LOCALETYPE(*LOCALEUCS2) or LOCALETYPE(*LOCALEUTF) compiler option is specified.End of change
__RTTI_DYNAMIC_CAST__
Start of change C++ compiler only Defined when the OPTION(*RTTIALL) or OPTION(*RTTICAST) compiler option is specified.End of change
Start of change__RTTI_TYPE_INFO__End of change
Start of change C++ compiler only Defined when the OPTION(*RTTIALL) or OPTION(*RTTITYPE) compiler option is specified.End of change
Start of change__SIZE_TYPE__End of change
Start of change C compiler only Indicates the underlying type of size_t on the current platform. For IBM i, it is unsigned int.End of change
__SRCSTMF__
C compiler only Defined when the SRCSTMF compiler option specifies the location of the source file being compiled.
__TERASPACE__
Defined when the TERASPACE(*YES *TSIFC) compiler option is specified.
__THW_AS400__
Indicates that the target hardware is an IBM i processor.
__TIMESTAMP__
A character string literal containing the date and time when the source file was last changed.

The date and time are in the form:

   "Day Mmm dd hh:mm:ss yyyy"

where:

Day represents the day of the week (Mon, Tue, Wed, Thu, Fri, Sat, or Sun).

Mmm represents the month in an abbreviated form (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, or Dec).

dd represents the day. If the day is less than 10, the first d is a blank character.

hh represents the hour.

mm represents the minutes.

ss represents the seconds.

yyyy represents the year.

Note:
Other compilers might not support this macro. If the macro is supported on other compilers, the date and time values might be different from the values shown here.
__TOS_OS400__
Indicates that the target operating system is i5/OS.
__UCS2__
Start of changeDefined when the LOCALETYPE(*LOCALEUCS2) compiler option is specified.End of change
__UTF32__
Start of changeDefined when the LOCALETYPE(*LOCALEUTF) compiler option is specified.End of change
__wchar_t
Start of changeIndicates that the typedef wchar_t has been defined.

C compiler only This macro is defined in the standard header file stddef.h.

C++ compiler only This macro is defined by the C++ compiler.

End of change
End of change

[ Top of Page | Previous Page | Next Page | Contents | Index ]