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
•__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.
To use some
See stdsyms(5) manpage or the
Assertions (#assert, #unassert)
Use #assert and #unassert to set a predicate name or predicate name and token to be tested with a #if directive. Note that you must also specify the
Syntax
Description
#assert sets the
Note that when testing a predicate, it must be preceded by the # character.
Overview of the Preprocessor 125