SQL/MX 3.2 Programming Manual for C and COBOL (H06.25+, J06.14+)

C/C++ Program Compilation
HP NonStop SQL/MX Release 3.2 Programming Manual for C and COBOL663854-002
15-14
Preprocessor Functions
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.
This #define directive:
#define SQL_Control_Table(defname)
EXEC SQL CONTROL TABLE defname TABLELOCK ‘OFF’;
SQL_Control_Table(fldrenty);
SQL_Control_Table(postact);
SQL_Control_Table(permdeny);
is expanded to:
EXEC SQL CONTROL TABLE fldrenty TABLELOCK 'OFF';
EXEC SQL CONTROL TABLE postact TABLELOCK 'OFF';
EXEC SQL CONTROL TABLE permdeny TABLELOCK 'OFF';
The preprocessor also expands #define directives that occur within host variable
parameters.