SQL/MX Programming Manual for C and COBOL (H06.04+)

C/C++ Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL540434-001
15-9
Preprocessor Functions
The syntax for using the preprocessor in each environment appears under Syntax for
the OSS-Hosted SQL/MX C/C++ Preprocessor on page 15-16 and Syntax for the
Windows-Hosted SQL/MX C/C++ Preprocessor on page 15-21.
Preprocessor Functions
The preprocessor processes C/C++ and SQL source statements.
C/C++ Source Statements
The preprocessor writes each C/C++ source statement to the C/C++ annotated source
file. The preprocessor parses the source file only to the extent necessary to detect
scoping levels, host variable declarations, host variable expressions, and embedded
SQL statements.
C Preprocessing Directives
The preprocessor ignores C directives except the #include, #define, #line, or
conditional compilation directives.
C #include Directive
The preprocessor expands first-level #include files. A comment is inserted in the
output source in the place of the original #include line, followed by the #include file
contents.
The preprocessor processes only #include files that have a.mxh extension or, with
the -h command line option specified, a.h extension.
The preprocessor ignores:
Nested #include directives
System #include directives (for example, <time.h>)
The NOLIST option if it is part of the #include file command
Examples:
The contents of the mine3.mxh file are included in the output source file:
#include "mine3.mxh"
Only sect1, sect2,and sect6 are included, and NOLIST is ignored:
#include "mine4.mxh (sect1,sect2,sect6)" NOLIST
The contents of the .h files are included if -h is specified, and NOLIST is ignored:
#include "mine.h"
#include "../includes/mine2.h" NOLIST