C/C++ Programmer's Guide (G06.25+)
Accessing Middleware Using HP C and C++ for
NonStop Systems
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
6-7
Pragmas for Tools.h++
For example, to get version 7 of the Tools.h++ library, a user might specify:
#pragma MAPINCLUDE PATH "rw/"= "$system.zincrw70."
To get version 6.1 of the Tools.h++ library, a user might specify:
#pragma MAPINCLUDE PATH "rw/"="$system.zrw."
3. The pragma:
pragma MAPINCLUDE FILE "from"="to"
tells C or C++ to modify any #include name ending with the "from" string. It
replaces the "from" string with the "to" string.
The following example treats #include "strstream.h" as #include
"strstreh":
PRAGMA MAPINCLUDE FILE "strstream.h"="strstreh"
This version of the pragma covers all cases where file names, other than Guardian
file names, are longer than the longest allowable Guardian file name.
4. The pragma:
pragma CPATHEQ [ "filename" ]
defaults to searching for a file named "cpatheq" in the compiler’s subvolume. You
can supply your own cpatheq file as an optional argument. For version 7, HP
provides a CPATHEQ file named TLHMAP. However, no CPATHEQ file is
provided for earlier versions of Tools.h++.
In the following example, the CPATHEQ pragma tells the C++ compiler to open the
$MYVOL.MYSUB.MYPATHEQ file and to process the information it contains:
PRAGMA CPATHEQ "$myvol.mysub.mypatheq"
The contents of a CPATHEQ file should be in the following suggested format:
#PRAGMA MAPINCLUDE "sys/type.h" = "systypeh"
#PRAGMA MAPINCLUDE PATH "rw/" =
"$system.zincrw70."
#PRAGMA MAPINCLUDE FILE "strstream.h" = "strstreh"
/*Standard C++ iostream header*/
#PRAGMA MAPINCLUDE FILE "iostream.h" = "iostreah"
/*Standard C++ iostream header*/
#PRAGMA MAPINCLUDE FILE "rw/cacheman.h" = "cachemah"
/*Rogue Wave Tools.h++ header*/
Usage Guidelines
•
A MAPINCLUDE FILE pragma and a MAPINCLUDE PATH pragma can both operate
on the same #include directive.