HP aC++/HP C A.06.28 Programmer's Guide Integrity servers (769150-001, March 2014)
4 Preprocessing Directives..........................................................................119
Overview of the Preprocessor.................................................................................................119
Syntax............................................................................................................................119
Usage Guidelines............................................................................................................119
Source File Inclusion (#include, #include_next).....................................................................120
Syntax.......................................................................................................................120
Description.................................................................................................................120
Examples...................................................................................................................121
Macro Replacement (#define, #undef)................................................................................121
Syntax.......................................................................................................................121
Description.................................................................................................................121
Macros with Parameters...............................................................................................121
Specifying String Literals with the # Operator..................................................................122
Concatenating Tokens with the ## Operator ..................................................................122
Example 1.............................................................................................................122
Example 2.............................................................................................................123
Using Macros to Define Constants.................................................................................123
Other Macros.............................................................................................................123
Example 1.............................................................................................................124
Example 2.............................................................................................................124
Using Constants and Inline Functions Instead of Macros...................................................124
Example................................................................................................................124
Predefined Macros......................................................................................................125
Assertions (#assert, #unassert)...........................................................................................125
Syntax.......................................................................................................................125
Description.................................................................................................................125
Conditional Compilation (#if, #ifdef, .. #endif)....................................................................126
Syntax.......................................................................................................................126
Description.................................................................................................................126
Using the defined Operator..........................................................................................127
Using the #if Directive..................................................................................................127
The #endif Directive.....................................................................................................127
Using the #ifdef and #ifndef Directives...........................................................................127
Nesting Conditional Compilation Directives....................................................................127
Using the #else Directive..............................................................................................127
Using the #elif Directive...............................................................................................127
Examples...................................................................................................................128
Line Control (#line)...........................................................................................................128
Syntax.......................................................................................................................128
Description.................................................................................................................128
Example....................................................................................................................128
IOSTREAM Performance Improvement Pragma.....................................................................129
Syntax:......................................................................................................................129
Pragma Directive (#pragma) and _Pragma Operator............................................................129
Syntax.......................................................................................................................129
Description.................................................................................................................129
Example....................................................................................................................129
Error Directive (#error)......................................................................................................130
Syntax.......................................................................................................................130
Example....................................................................................................................130
Warning Directive............................................................................................................130
Syntax.......................................................................................................................130
Trigraph Sequences..........................................................................................................130
Examples........................................................................................................................130
10 Contents