6.10.8 Predefined macro names

1

The following macro names[1] shall be defined by the implementation:

__DATE__

The date of translation of the preprocessing translation unit: a character string literal of the form “Mmm dd yyyy”, where the names of the months are the same as those generated by the asctime function, and the first character of dd is a space character if the value is less than 10. If the date of translation is not available, an implementation-defined valid date shall be supplied.

__FILE__

The presumed name of the current source file (a character string literal).[2]

__LINE__

The presumed line number (within the current source file) of the current source line (an integer constant).[2]

__STDC__

The integer constant 1, intended to indicate a conforming implementation.

__STDC_HOSTED__

The integer constant 1 if the implementation is a hosted implementation or the integer constant 0 if it is not.

__STDC_MB_MIGHT_NEQ_WC__

The integer constant 1, intended to indicate that, in the encoding for wchar_t, a member of the basic character set need not have a code value equal to its value when used as the lone character in an integer character constant.

__STDC_VERSION__

The integer constant 199901L.[3]

__TIME__

The time of translation of the preprocessing translation unit: a character string literal of the form “hh:mm:ss” as in the time generated by the asctime function. If the time of translation is not available, an implementation-defined valid time shall be supplied.

2

The following macro names are conditionally defined by the implementation:

__STDC_IEC_559__

The integer constant 1, intended to indicate conformance to the specifications in annex F (IEC 60559 floating-point arithmetic).

__STDC_IEC_559_COMPLEX__

The integer constant 1, intended to indicate adherence to the specifications in informative annex G (IEC 60559 compatible complex arithmetic).

__STDC_ISO_10646__

An integer constant of the form yyyymmL (for example, 199712L). If this symbol is defined, then every character in the Unicode required set, when stored in an object of type wchar_t, has the same value as the short identifier of that character. The Unicode required set consists of all the characters that are defined by ISO/IEC 10646, along with all amendments and technical corrigenda, as of the specified year and month.

3

The values of the predefined macros (except for __FILE__ and __LINE__) remain constant throughout the translation unit.

4

None of these macro names, nor the identifier defined, shall be the subject of a #define or a #undef preprocessing directive. Any other predefined macro names shall begin with a leading underscore followed by an uppercase letter or a second underscore.

5

The implementation shall not predefine the macro __cplusplus, nor shall it define it in any standard header.

Forward References

Footnotes