HP aC++/HP C A.06.25 Programmer's Guide

To use some HP-UX system functions you may need to define the symbol
__HPUX_SOURCE.
See stdsyms(5) manpage or the HP-UX Reference Manual for more information.
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 -ext option at
compile and link time.
Syntax
#assertpredicate-name[token-name]
#unassertpredicate-name[token-name]
Description
#assert sets the predicate-name [token-name] to true. #unassert sets the
predicate-name [token-name] to false.
Note that when testing a predicate, it must be preceded by the # character.
HP aC++ predefines the following predicates:
#assert system(unix)
#assert model(lp64) // when +DA2.0W is used
#assert model(ilp32) // default
#assert endian(big)
Example:
int void main()
{
#assert dimensions(three) // Set predicate and token to true.
#if #dimensions(two)
#error "May not compile in 2 dimensions"
#endif
#if #dimensions(three)
int x, y, z;
#endif
#unassert dimensions // Set predicate and all tokens to false.
}
Conditional Compilation (#if, #ifdef, .. #endif)
Conditional compilation directives allow you to delimit portions of code that are
compiled only if a condition is true.
166 Preprocessing Directives