6.10.8 Predefined macro names

Previous Table of Contents "New C Standard" commentary

2004 The following macro names151) shall be defined by the implementation:

2005 __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.

2006 If the date of translation is not available, an implementation-defined valid date shall be supplied.

2007 __FILE__ The presumed name of the current source file (a character string literal).152)

2008 __LINE__ The presumed line number (within the current source file) of the current source line (an integer constant).152)

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

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

2011 __STDC_VERSION__ The integer constant 199901L.153)

2012 __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.

2013 If the time of translation is not available, an implementation-defined valid time shall be supplied.

2014 The following macro names are conditionally defined by the implementation:

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

2016 151) See “future language directions” (6.11.9).

2017 152) The presumed source file name and line number can be changed by the #line directive.

2018 153) This macro was not specified in ISO/IEC 9899:1990 and was specified as 199409L in ISO/IEC 9899/AMD1:1995.

2019 The intention is that this will remain an integer constant of type long int that is increased with each revision of this International Standard.

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

2021 __STDC_ISO_10646__ An integer constant of the form yyyymmL (for example, 199712L) ,.

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

2023 The Unicode required set consists of all the characters that are intended to indicate that values of type wchar_t are the coded representations of the characters defined by ISO/IEC 10646, along with all amendments and technical corrigenda, as of the specified year and month.

2024 __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.

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

2026 None of these macro names, nor the identifier defined, shall be the subject of a #define or a #undef preprocessing directive.

2027 Any other predefined macro names shall begin with a leading underscore followed by an uppercase letter or a second underscore.

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

2029 Forward references: the asctime function (7.23.3.1), standard headers (7.1.2).

Next

Created at: 2008-01-30 02:39:45 The text from WG14/N1256 is copyright © ISO