C/C++ Programmer's Guide (G06.25+)
Preprocessor Directives and Macros
HP C/C++ Programmer’s Guide for NonStop Servers—429301-002
12-5
#if, #elif, #ifdef, #ifndef, #else, and #endif
#if int-constant-expression newline [ source-text ]
introduces an if section that conditionally includes source text based on the value 
of a constant expression. The new line following the constant expression 
terminates the #if directive line, and source-text is the text included if int-
constant-expression has a nonzero value.
The constant expression must evaluate to an integral value; also, it cannot include 
sizeof or cast operators or an enumeration constant.
#elif int-constant-expression newline [ source-text ]
introduces an if section that conditionally includes source text based on the value 
of a constant expression. The new line following the constant expression 
terminates the #elif directive line, and source-text is the text included if int-
constant-expression has a nonzero value.
The constant expression must evaluate to an integral value; also, it cannot include 
sizeof or cast operators or an enumeration constant.
The maximum number of nested #elif directives is 32.
#ifdef identifier newline [ source-text ]
introduces an if section that conditionally includes source text based on the 
existence of an identifier as a macro name. identifier specifies the identifier to 
test, and the new line following it terminates the #ifdef directive line. source-
text is the source text that is included if identifier is currently defined as a 
macro name.
#ifndef identifier newline [ source-text ]
introduces an if section that conditionally includes source text based on the 
nonexistence of an identifier as a macro name. identifier specifies the 
identifier to test, and the new line following it terminates the #ifndef directive line. 
source-text is the source text that is included if identifier is not currently 
defined as a macro name.
#else newline [ source-text ]
is the else group of an if section. The new line following the #else directive 
terminates the directive line. source-text specifies the source text that is 
included if the condition specified in the if group is not met.
 { #if int-constant-expression } newline [ source-text ]
 { #elif int-constant-expression }
 { #ifdef identifier } 
 { #ifndef identifier }
#else-group:
 #else newline [ source-text ]










