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 COBOL544617-003
15-11
Preprocessor Functions
int a1;
EXEC SQL END DECLARE SECTION;
#pragma section sect2
EXEC SQL BEGIN DECLARE SECTION;
int a2;
EXEC SQL END DECLARE SECTION;
#pragma section sect3
EXEC SQL BEGIN DECLARE SECTION;
int a3;
EXEC SQL END DECLARE SECTION;
C #Pragma MXH and #Pragma NOMXH Directive
The preprocessor processes all the user header files (for example, #include
"file1.h") , that are within the pragma directives MXH and NOMXH, regardless of the
header file extension.
Example:
The contents of the mine.h and mine3 files are not included in the output source file.
The content of the ../includes/mine2 file is processed and written to the output
source file:
#include "mine.h"
#pragma MXH
#include "../includes/mine2"
#pragma NOMXH
#include "mine3"
C #define Directive
The preprocessor scans all #define directives and stores them in a table for
evaluation when they are encountered. The preprocessor evaluates the stored defines
for all legal combinations of conditional compilation.
A #define specified on the preprocessor command line must also be specified on the
C/C++ command line. The preprocessor interprets and uses #define information but
does not remove it from the generated code. The C/C++ compiler must get the same
directive to interpret the code the same way. If you use the c89 utility, this is not a
concern.
The preprocessor checks each nonkeyword that begins a line to determine if it is in the
define table. If it is, it is expanded. However, you must ensure that define-engendered
substitutions result in valid code.