SQL/MX Programming Manual for C and COBOL (H06.10+, J06.03+)
C/C++ Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL—544617-003
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-17 and Syntax for the
Windows-Hosted SQL/MX C/C++ Preprocessor on page 15-23.
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 the C directives except the #include, #define, #line,
# pragma, 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.
By default, the preprocessor processes only the #include files on OSS, that have a
.mxh extension. Using the -h command-line option, the preprocessor processes the
#include files with any extension or no extension. The preprocessor also processes
the #include files specified within the pragma MXH and NOMXH directives. It supports
Guardian DEFINEs for the #include directive. The OSS-hosted SQL/MX
preprocessor resolves the Guardian class MAP DEFINE with the actual filename and
processes it. The Windows-hosted SQL/MX preprocessor does not support Guardian
DEFINEs.
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










