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-7
Pragmas for Tools.h++
Each set of class library include files from a given vendor uses the same directory
for each class library provided. This is not a problem on small systems, because
users typically install their own copy of the version they need for their own use. On
large multiuser systems, however, it is more likely that users might want to use
different versions of a specific class library.
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.
This 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 this 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 this 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*/