Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Predefined preprocessor names

&pagelevel(3)&pagelevel

When the C/C++ compiler is used for compilation in the SDF environment (COMPILE, CHECK-SYNTAX, and PREPROCESS statements), some preprocessor macros and assertions are predefined, depending on which language mode is selected and which additional options are specified.

For a few macros the value is fixed. It cannot be changed, neither on the command line nor in the source (via #define or #undef). These macros are: __cplusplus, __STDC__, __STDC_VERSION__ and __SNI__STDCplusplus.

Predefined preprocessor macros (defines)

The options specified below are all part of the MODIFY-SOURCE-PROPERTIES statement:

_BOOLIn the language modes C++ V3, C++ 2017 and C++ 2020 with the option KEYWORD-BOOL=*YES

__CGLOBALS_PRAGMA

Always set

__cplusplus

In all C++ language modes:

== 1 in Cfront C++ mode
== 2 in extended C++ V3 mode
== 199612L in strict C++ V3 mode
== 201703L in C++ 2017 mode
== 202002L in C++ 2020 mode

c_plusplus

In all C++ language modes

__cpp_...

Several defines specified in the C++ standard. They are set when the corresponding feature is supported in the current language mode.

__CFRONT_V3

In language mode Cfront C++

__EDG_NO_IMPLICIT_INCLUSION

In the modes C++ V3, C++ 2017 and C++ 2020, if implicit inclusion has been disabled with the option IMPLICIT-INCLUDE=*NO within the framework of template instantiation

__EXISTCGLOB

Always set

__HALF_TAG_LOOKUP

Always set

_IEEE

Option FP-ARITHMETICS=*IEEE in MODIFY-MODULE-PROPERTIES statement

LANGUAGE_C

Always set

_LANGUAGE_C

Always set

_LIBCPP_STD_VER

In mode C++ 2020: the compiler will set it to the value 17
In mode C++ 2017: the library headers will set it to the value 17

__LITERAL_ENCODING_ASCII


Option LITERAL-ENCODING=*ASCII[-FULL]

__LITERAL_ENCODING_EBCDIC


Option LITERAL-ENCODING=*EBCDIC[-FULL]/*NATIVE

_LONGLONG

Option LONGLONG=*YES

__OLD_SPECIALIZATION_SYNTAX


== 1 with the option SPECIALIZATION=*OLD

__SHORT_NAMES

Is defined, if C-NAMES=*SHORT is specified

__SIGNED_CHARS__

Option SIGNED-CHARACTER=*YES

__SMALL_VA_DCL

Always set

__SNI

In all C modes and in Cfront C++ mode

__SNI_HOST_BS2000

Always set

__SNI_HOST_BS2000_POSIX

Never set (reserved for compilation in POSIX)

__SNI_PRINTF_CHECK

Always set

__SNI__STDCplusplus

in all C++ language modes:

== 0 in extended language modes (STRICT=*NO)
== 1 strict language modes (STRICT=*YES)

__SNI_TARG_BS2000

Always set

__SNI_TARG_BS2000_POSIX

Never set (reserved for compilation in POSIX)

__STDC__

Always set:

== 0 in extended language modes (STRICT=*NO)
== 1 in strict language modes (STRICT=*YES)

__STDC_HOSTED__

Always set

__STDC_NO_ATOMICS__

Always set

__STDC_NO_COMPLEX__

Always set

__STDC_NO_THREADS__

Always set

__STDCPP_DEFAULT_NEW_ALIGNMENT__


Always set

== 8U

__STDC_UTF_16__

Always set

__STDC_UTF_32__

Always set

__STDC_VERS_CRTE__

Undefined in K&R C mode

== 199409L in language modes C89, Cfront C++ and C++ V3

== 201112L in language modes C11, C++ 2017 and C++ 2020

__STDC_VERSION__

Undefined in K&R C mode

== 199409L in language mode C89 and in all C++ language modes

== 201112L in language mode C11

_STRICT_STDC

in strict language modes (STRICT=*YES)

_WCHAR_T

Option KEYWORD-WCHAR=*YES (default in den language modes C++ V3, C++ 2017 and C++ 2020)
If this option is not set (e.g. in C modes or in Cfront C++ mode), _WCHAR_T is defined in various standard headers to issue a typedef for wchar_t.

_WCHAR_T_KEYWORD

Option KEYWORD-WCHAR=*YES (default in language modes C++ V3, C++ 2017 and C++ 2020)


Predefined preprocessor assertions (#assert)

The options specified below are all part of the MODIFY-SOURCE-PROPERTIES statement:

data_model(bit32)

Always set

cpu(7500)

On generating /390 code

machine(7500)

On generating /390 code

system(bs2000)

Always set