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

For a detailed description of all the C compiler pragmas, see Chapter 13: Compiler
Pragmas.
define identifier [ integer-constant ]
defines identifier as a preprocessor symbol. If identifier is followed by an integer
or character constant, identifier is defined as an object-like macro that expands to the
given value.
Usage Guidelines
Remember that the output that is produced from running Cprep is kept in an intermediate file.
Each time that you run Cprep, the output is added to the end of the file. Therefore, if
intermediate files exist, purge them before running Cprep again.
The pragmas that you specify for Cprep cannot be abbreviated. You must type out the full
name for the pragma.
Cprep and Cfront both send error and warning messages to stderr. The default location
for stderr is the terminal. You can assign stderr to a specific file and collect all Cprep
and Cfront error and warning messages there.
To send error and warning messages to a file, assign stderr to the desired file name prior
to invoking Cprep. You assign stderr to a file name:
ASSIGN STDERR, file-name
To return to the default location, enter:
CLEAR ASSIGN STDERR
Example
In this example, the C++ source file progcp is input to Cprep. An intermediate file, intfile1,
is created by Cprep for later use by Cfront. The SSV pragma SSV0 causes any header files in
progcp to be searched for in the subvolume hdrvol; that is, Cprep looks in subvolume hdrvol
for a file named hdrh if progcp contains the statement #include "hdrh."
CPREP/IN progcp, OUT intfile1/define __cplusplus, SSV0 "hdrvol"
C++ Translator Cfront
Cfront generates code for the TNS C compiler. In so doing, Cfront performs these functions:
Always generates function prototypes
Uses the NOWIDE or RUNNABLE pragmas, if they were specified on the Cprep run command
line or in the C++ source
Generates these pragmas: C_PLUS_PLUS, C_PLUS_PLUS_STMT, NOWARN(134, 135),
and SEARCH
Produces a C source file that serves as the input to the TNS C compiler
Pragmas Generated by Cfront
Cfront generates these pragmas: C_PLUS_PLUS, C_PLUS_PLUS_STMT, NOWARN(134, 135), and
SEARCH. Each of these pragmas is explained below.
UsePragma
notifies the TNS C compiler that this object file is derived from C++ source code.C_PLUS_PLUS
identifies a C++ statement to the TNS C compiler. This pragma causes the next
C statement to be identified as the start of generated C code for the C++ statement
C_PLUS_PLUS_STMT
to be found in the file and at the line number specified by the latest #line
directive. This information is used for symbolic debugging.
276 Compiling, Binding, and Accelerating TNS C++ Programs