HP aC++/HP C A.06.25 Programmer's Guide
#include <stream.h>
#define distance1(rate,time) (rate * time)
// replaced by :
inline int distance2 ( int rate, int time )
{
return ( rate * time );
}
int main()
{
int i1 = 3, i2 = 3;
printf("Distance from macro : %d\n",
distance1(i1,i2) )
; printf("Distance from inline function : %d\n",
distance2(i1,i2) );
}
Predefined Macros
In addition to __LINE__ and __FILE__, HP aC++ provides the following predefined
macros. The list describes the complete set of predefined macros that produce special
information. They cannot be undefined nor changed.
• __cplusplus produces the decimal constant 199707L, indicating that the
implementation supports ANSI/ISO C++ International Standard features. For
example,
#if (__cplusplus >= 199711L)
#include
#else
#include
• __DATE__ produces the date of compilation in the form Mmm dd yyyy.
• __FILE__ produces the name of the file being compiled.
• __HP_aCC identifies the HP aC++ compiler driver version. It is represented as a
6-digit number in the format mmnnxx, where mm is the major version number, nn
is the minor version number, and xx is any extension. For example, for version
A.01.21, __HP_aCC=012100.
• __hpux is defined.
• __ia64 is defined.
• __LINE__ produces the current source line number.
• __LP64__ is defined for +DD64.
• _ILP32 is defined for +DD32.
• _LP64 is defined for +DD64.
• __STDCPP__ produces the decimal constant 1, indicating that the preprocessor is
in ANSI C/C++ mode.
• __TIME__ produces the time of compilation in the form hh:mm:ss.
• __unix is defined.
Overview of the Preprocessor 165