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-10
Preprocessor Functions
The contents of the mine.h and mine2 files are included if -h is specified, and
NOLIST is ignored:
#include "mine.h"
#include "../includes/mine2" NOLIST
The contents of file mapped by DEFINE =cdef1 are included, if -h is specified:
#include "=cdef1"
As with any #include file inclusion, you must ensure that implementation of
conditional compilation does not result in repeated file inclusion.
When a C #pragma directive is contained in an included file, it is processed by the
preprocessor.
If the file incl.mxh contains:
#pragma section sect1
EXEC SQL BEGIN DECLARE SECTION;
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;
this construct:
#include "incl.mxh (sect1, sect3)" NOLIST
is expanded to:
/* #include "incl.h (sect1, sect3)" NOLIST */
EXEC SQL BEGIN DECLARE SECTION;
int a1;
EXEC SQL END DECLARE SECTION;
EXEC SQL BEGIN DECLARE SECTION;
int a3;
EXEC SQL END DECLARE SECTION;
This construct:
#include "incl.mxh" NOLIST
is expanded to:
/* #include "incl.h" NOLIST */
#pragma section sect1
EXEC SQL BEGIN DECLARE SECTION;