ILE C/C++ Predefined Macros

The 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.

__BASE_FILE__
Indicates the fully qualified name of the primary source file.
__BOOL__
C++ compiler only Indicates that the bool keyword is accepted.
_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__
Defined 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.
__cplusplus98__interface__
C++ compiler only Defined when the LANGLVL(*ANSI) compiler option is specified.
__C99_BOOL
C compiler only Indicates support for the _Bool data type. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_CPLUSCMT
C compiler only Indicates support for C++ style comments. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_COMPOUND_LITERAL
Indicates support for compound literals.

C compiler only Defined when the LANGLVL(*EXTENDED) compiler option is in effect.

C++ compiler only Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.

__C99_DESIGNATED_INITIALIZER
C compiler only Indicates support for designated initialization. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_DUP_TYPE_QUALIFIER
C compiler only Indicates support for duplicated type qualifiers. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_EMPTY_MACRO_ARGUMENTS
C compiler only Indicates support for empty macro arguments. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_FLEXIBLE_ARRAY_MEMBER
C compiler only Indicates support for flexible array members. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_FUNC__
Indicates support for the __func__ predefined identifier.

C compiler only Defined when the LANGLVL(*EXTENDED) compiler option is in effect.

C++ compiler only Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.

__C99_HEX_FLOAT_CONST
Indicates support for hexadecimal floating constants.

C compiler only Defined when the LANGLVL(*EXTENDED) compiler option is in effect.

C++ compiler only Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.

__C99_INLINE
C compiler only Indicates support for the inline function specifier. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_LLONG
C compiler only Indicates support for C99-style long long data types and literals. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_MACRO_WITH_VA_ARGS
Indicates support for function-like macros with variable arguments.

C compiler only Defined when the LANGLVL(*EXTENDED) compiler option is in effect.

C++ compiler only Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.

__C99_MAX_LINE_NUMBER
Indicates that the maximum line number is 2147483647.

C compiler only Defined when the LANGLVL(*EXTENDED) compiler option is in effect.

C++ compiler onlyDefined when the LANGLVL(*EXTENDED0X) compiler option is in effect.

__C99_MIXED_DECL_AND_CODE
C compiler only Indicates support for mixed declaration and code. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_MIXED_STRING_CONCAT
C++ compiler only Indicates support for concatenation of wide string and non-wide string literals. Defined when the LANGLVL(*EXTENDED0X) compiler option is in effect.
__C99_NON_CONST_AGGR_INITIALIZER
C compiler only Indicates support for non-constant aggregate initializers. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_NON_LVALUE_ARRAY_SUB
C compiler only Indicates support for non-lvalue subscripts for arrays. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_PRAGMA_OPERATOR
Indicates support for the _Pragma operator.

C compiler only Defined when the LANGLVL(*EXTENDED) compiler option is in effect.

C++ compiler only Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.

__C99_RESTRICT
C++ compiler only Indicates support for the C99 restrict qualifier. Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.
__C99_STATIC_ARRAY_SIZE
C compiler only Indicates support for the static keyword in array parameters to functions. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_VAR_LEN_ARRAY
C compiler only Indicates support for variable length arrays. Defined when the LANGLVL(*EXTENDED) compiler option is in effect.
__C99_VARIABLE_LENGTH_ARRAY
C++ compiler only Indicates support for variable length arrays. Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.
__DIGRAPHS__
Indicates support for digraphs.
__EXTENDED__
C compiler only Defined when the LANGLVL(*EXTENDED) compiler option is in effect.

C++ compiler only Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) 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 IBM i.
__IBMC__
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.2 compiler with the TGTRLS(*CURRENT) compiler option, __IBMC__ returns the integer value 720.

__IBMCPP__
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.2 compiler with the TGTRLS(*CURRENT) compiler option, __IBMCPP__ returns the integer value 1110. 1110 means the ILE C++ compiler is based on the XL C++ V11.1 compiler.
__IBM__ALIGN
C++ compiler only Indicates support for the __align specifier.
__IBM_ATTRIBUTES
C++ compiler only Indicates support for type, variable, and function attributes. Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBM_COMPUTED_GOTO
C++ compiler only Indicates support for computed goto statements. Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBM_DFP__
Indicates support for decimal floating-point types.

C compiler only Defined when the LANGLVL(*EXTENDED) compiler option is in effect.

C++ compiler only Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.

__IBM_EXTENSION_KEYWORD
C++ compiler only Indicates support for the __extension__ keyword. Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBM_INCLUDE_NEXT
Indicates support for the #include_next preprocessing directive.
__IBM_LABEL_VALUE
C++ compiler only Indicates support for labels as values. Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBM_LOCAL_LABEL
C++ compiler only Indicates support for local labels. Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBM_MACRO_WITH_VA_ARGS
C++ compiler only Indicates support for variadic macro extensions. Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBM_TYPEOF__
Indicates support for the __typeof__ or typeof keyword. This macro is always defined for C.

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

__IBMCPP_AUTO_TYPEDEDUCTION
C++ compiler only Indicates support for the auto type deduction feature. Defined when the LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBMCPP_C99_PREPROCESSOR
C++ compiler only Indicates support for the C99 preprocessor features adopted in the C++0x standard. Defined when the LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBMCPP_DECLTYPE
C++ compiler only Indicates support for the decltype feature. Defined when the LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBMCPP_DELEGATING_CTORS
C++ compiler only Indicates support for the delegating constructors feature. Defined when the LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBMCPP_EXTENDED_FRIEND
C++ compiler only Indicates support for the extended friend declarations feature. Defined when the LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBMCPP_EXTERN_TEMPLATE
C++ compiler only Indicates support for the explicit instantiation declarations feature. Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBMCPP_INLINE_NAMESPACE
C++ compiler only Indicates support for the inline namespace definitions feature. Defined when the LANGLVL(*EXTENDED0X) compiler option is in effect.
__IBMCPP_STATIC_ASSERT
C++ compiler only Indicates support for the static assertions feature. Defined when the LANGLVL(*EXTENDED0X) compiler option is in effect.
__IFS_IO__
Defined when the SYSIFCOPT(*IFSIO) or SYSIFCOPT(*IFS64IO) compiler option is specified.
__IFS64_IO__
Defined 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.
__ILEC400__
C compiler only Indicates that the ILE C compiler is being used.
__ILEC400_TGTVRM__
C compiler only Same as the __OS400_TGTVRM__ macro.
_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.
__LONGDOUBLE64
Indicates that the size of a long double type is 64 bits. This macro is always defined.
_LONG_LONG
Indicates support for IBM long long data types.

C compiler only Defined when the LANGLVL(*EXTENDED) compiler option is in effect.

C++ compiler only Defined when the LANGLVL(*EXTENDED) or LANGLVL(*EXTENDED0X) compiler option is in effect.

__NO_RTTI__
C++ compiler only Defined when the OPTION(*NORTTI) compiler option is in effect.
__OPTIMIZE__
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)

__OS400__
This macro is always defined when the compiler is used with the IBM i operating system.
__OS400_TGTVRM__
Defines 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(V7R2M0) compiler option, this macro returns the integer value 720.
__POSIX_LOCALE__
Defined when the LOCALETYPE(*LOCALE) or LOCALETYPE(*LOCALEUCS2) or LOCALETYPE(*LOCALEUTF) compiler option is specified.
__RTTI_DYNAMIC_CAST__
C++ compiler only Defined when the OPTION(*RTTIALL) or OPTION(*RTTICAST) compiler option is specified.
__RTTI_TYPE_INFO__
C++ compiler only Defined when the OPTION(*RTTIALL) or OPTION(*RTTITYPE) compiler option is specified.
__SIZE_TYPE__
C compiler only Indicates the underlying type of size_t on the current platform. For IBM i, it is unsigned int.
__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 IBM i.
__UCS2__
Defined when the LOCALETYPE(*LOCALEUCS2) compiler option is specified.
__UTF32__
Defined when the LOCALETYPE(*LOCALEUTF) compiler option is specified.
__wchar_t
Indicates 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.