H-Series Application Migration Guide (H06.03+)

Native C and C++ Migration Tasks
H-Series Application Migration Guide429855-006
5-4
Check Use of Feature Test Macro
Check Use of Feature Test Macro
The _TNS_E_TARGET feature test macro replaces the _TNS_R_TARGET macro in
the TNS/E native C and C++ compilers. This macro identifies the platform on which a
program is being compiled to run. It can be used to conditionally compile code, as in
this example:
#ifdef _TNS_E_TARGET
/* TNS/E-specific code goes here. */
#else
/* Other code goes here. */
#endif
Alternatively, you can use the _TANDEM_ARCH_ feature test macro to identify the
platform. This macro returns these values:
Code that was previously thought to be specific to TNS/R but could actually be
targeted to TNS/E native C or C++ should test this macro. You can also use this macro
to create programs to run on both native and non-native systems. For example:
#if _TANDEM_ARCH_ == 0
/* Non-native code goes here. */
#else
/* Native code goes here. */
#endif
Changed Pragmas and Flags
The native TNS/E C and C++ compilers support the same pragmas and flags as the
native TNS/R C and C++ compilers with the exceptions noted in this discussion. These
pragmas and flags are not meaningful or have different behavior on H-series systems.
In most cases, obsolete pragmas and flags have no effect if they appear an H-series
program.
Value Platform
0TNS
1TNS/R
2TNS/E
Note. Most pragmas have equivalent flags in the OSS and PC environments.