C/C++ Programmer's Guide (G06.25+)
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
13-61
MAPINCLUDE
MAPINCLUDE
The MAPINCLUDE pragma specifies how to transform file names within #include 
directives.
The pragma default settings are:
Usage Guidelines
•
The MAPINCLUDE pragma can be specified only in the source file.
•
PRAGMA MAPINCLUDE "from"="to" directs the compiler to replace any name in 
an #include directive that fully matches the from string with the to string.
•
PRAGMA MAPINCLUDE PATH "from"="to" directs the compiler to replace any 
directory pathname in an #include directive that begins with the from string with 
the to string.
•
PRAGMA MAPINCLUDE FILE "from"="to" directs the compiler to replace any 
file name in an #include directive that ends with the from string with the to 
string.
•
Only one MAPINCLUDE pragma without PATH or FILE can be performed on each 
#include.
•
A MAPINCLUDE FILE and a MAPINCLUDE PATH can both operate on the same 
#include.
•
Only one MAPINCLUDE pragma can be specified for each from string.
•
For additional guidelines and examples of using the MAPINCLUDE pragma with 
class libraries such as Tools.h++, see Pragmas for Tools.h++ on page 6-6. 
•
The following two examples illustrate the significance of specifying or omitting the 
FILE option with the MAPINCLUDE pragma. You have the following two 
#include directives:
#include "machin.h"
#include "n.h"
MAPINCLUDE [ FILE | PATH ] "from" = "to"
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler Not set Not set
G-series TNS c89 utility N.A. N.A.
TNS/R native C and C++ compilers  Not set Not set
Native c89 utility N.A. N.A.
TNS/E native C and C++ compilers  Not set Not set










