ILE C/C++ Compiler Reference


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 for the Create Module and Create Bound Program commands 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__ 
Defined when the SYSIFCOPT(*ASYNCSIGNAL) compiler option is in effect.

Defined when TERASPACE(*YES *TSIFC) STGMDL(*TERASPACE) DTAMDL(*LLP64) RTBND(*LLP64) is in effect.

 _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 
Defined when the #pragma chars(unsigned) directive is in effect, or when the DFTCHAR compiler option is set to *UNSIGNED. Indicates default character type is unsigned.

 __cplusplus98__interface__ 
Defined by C++ compiler when the LANGLVL(*ANSI) compiler option is specified.

 __EXTENDED__ 
Defined when the LANGLVL(*ANSI) compiler option is not 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 iSeries processor.

 __HOS_OS400__ 
Indicates that the host operating system is OS/400.

 __IBMCPP__ 
Indicates the version number of the ILE C/C++ compiler.

 __IFS_IO__ 
Defined when SYSIFCOPT(*IFSIO) or SYSIFCOPT(*IFS64IO) is specified on the Create Module or Create Bound Program commands.

 __IFS64_IO__ 
Defined when SYSIFCOPT(*IFS64IO) is specified on the Create Module or Create Bound Program commands. When this macro is defined, _LARGE_FILES and _LARGE_FILE_API are also defined in the relevant IBM-supplied header files.

 __ILEC400__ 
Defined only by the compiler. You can use this macro in source code that is compiled for several platforms. Mark code that is to be compiled only for the iSeries platform with #ifdef __ILEC400__ or, #if defined(__ILEC400__) preprocessor directives.

 __ILEC400_TGTVRM__ 
Defined by the compiler as an integral value that maps to the version/release/modification of the OS/400(R) that the module or program being compiled is intended to run on. The target release, VxRyMz, translates to an __ILEC400_TGTVRM__ value of xyz, where x, y, and z are integer values. For example, a target release of V3R7M0 will cause the macro to have an integral value of 370.

 _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__ 
Defined when the RTBND(*LLP64) compiler option is in effect.

 __OS400__ 
This macro is always defined when the compiler is used with the OS/400 operating system.

 __OS400_TGTVRM__ 
Defined only by the compiler as an integral value that maps to the version/release/modification of the OS/400(R) that the module or program being compiled is intended to run on. The target release, VxRyMz, translates to an __OS400_TGTVRM__ value of xyz, where x, y, and z are integer values.

 __POSIX_LOCALE__ 
Defined when the LOCALETYPE(*LOCALE) or LOCALETYPE(*LOCALEUCS2) compiler options are specified.

 __RTTI_DYNAMIC_CAST__ 
Defined when the OPTION(*RTTIALL) or OPTION(*RTTICAST) compiler options are specified, for C++ programs only. This macro is not defined for C.

 __SRCSTMF__ 
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 iSeries processor.

 __TIMESTAMP__ 
A character string literal containing the date and time when the source file was last changed.

The date and time will be 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 will be a blank character.

hh represents the hour.

mm represents the minutes.

ss represents the seconds.

yyyy represents the year.

Note:
Other compilers may not supported this macro. If the macro is supported on other compilers, the date and time values may be different than those that are shown here.

 __TOS_OS400__ 
Indicates that the target operating system is OS/400.

 __UCS2__ 
Defined when LOCALETYPE(*LOCALEUCS2) is specified on the Create Module or Create Bound Program commands.

 __UTF32__ 
Defined when LOCALETYPE(*LOCALEUTF) is specified on the Create Module or Create Bound Program commands.

 __wchar_t 
Defined by the standard header file stddef.h.

Defined by the C++ compiler.


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