General macros

The following predefined macros are always predefined by the compiler. Unless noted otherwise, all the following macros are protected, which means that the compiler will issue a warning if you try to undefine or redefine them.

Table 1. General predefined macros
Predefined macro name Description Predefined value
__BASE_FILE__ Indicates the name of the primary source file. The fully qualified file name of the primary source file.
__DATE__ Indicates the date that the source file was preprocessed. A character string containing the date when the source file was preprocessed.
__FILE__ Indicates the name of the preprocessed source file. A character string containing the name of the preprocessed source file.
__FUNCTION__ Indicates the name of the function currently being compiled. A character string containing the name of the function currently being compiled.
__LINE__ Indicates the current line number in the source file. An integer constant containing the line number in the source file.
__SIZE_TYPE__ Indicates the underlying type of size_t on the current platform. Not protected. unsigned int in 32-bit compilation mode and unsigned long in 64-bit compilation mode.
__TIME__ Indicates the time that the source file was preprocessed. A character string containing the time when the source file was preprocessed.
__TIMESTAMP__ Indicates the date and time when the source file was last modified. The value changes as the compiler processes any include files that are part of your source program. A character string literal 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.