C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Accessing Middleware Using HP C and C++ for
NonStop Systems
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
6-6
Pragmas for Tools.h++
Pragmas for Tools.h++
You need to use the MAPINCLUDE and CPATHEQ pragmas to map UNIX or OSS
pathnames to Guardian file names. This examples illustrate the use of these pragmas:
1. The pragma:
pragma MAPINCLUDE "from"="to"
tells C or C++ to modify any #include name fully matching the "from" string. The
effect is to replace the "from" string with the "to" string.
This example treats #include "sys/types.h" as #include
"$system.system.systypeh":
PRAGMA MAPINCLUDE "sys/types.h"="$system.system.systypeh"
This example treats #include <sys/types.h> as #include
<systypeh>:
PRAGMA MAPINCLUDE "sys/types.h"="systypeh"
This version of the pragma covers all cases where an exact match is required.
2. The pragma:
pragma MAPINCLUDE PATH "from"="to"
tells C or C++ to modify any #include name starting with the "from" string. It
replaces the "from" string with the "to" string. Note that the slash is not a delimiter;
it is part of the string.
This example treats #include "rw/cstring.h" as #include
"$system.rw.cstringh":
PRAGMA MAPINCLUDE PATH "rw/"="$system.rw."
Note that cstring.h is not a Guardian file name. The compiler treats “.h” as
“h”.
This example treats #include <sys/type.h> as #include
<systype.h>:
PRAGMA MAPINCLUDE PATH "sys/"="sys"
This version of the pragma handles the problem of multiple versions of class
libraries installed on a single system.
TIMEDATC Example source file
TPDTESTC Template example
TVDTESTC Template example
Table 6-3. Tools.h++ Example Files for Version 7 (page 2 of 2)
Example File Description of Contents