H-Series Application Migration Guide (H06.07+, J06.03+)
Native C and C++ Migration Tasks
H-Series Application Migration Guide—429855-008
5-8
Native C and C++ Run-Time Library and Tools.h++
Migration Issues
TNS/E platform. For example, the following conditional directives are frequently used
to conditionally compile source code for TNS/R and TNS platforms:
#ifdef TNS_R_TARGET
printf ("Code intended for TNS/R");
#else
printf ("Code intended for TNS");
printf ("Unintentionally compiled for TNS/E");
#endif
However, when this sequence is used in a TNS/E compilation, the source statements
following #else are unintentionally included in the compilation.
Similarly, the following sequence also has unintended results when used in a TNS/E
compilation:
#ifndef TNS_R_TARGET
printf ("Code intended for TNS");
printf ("Unintentionally compiled for TNS/E");
#endif
In this case, the statement #ifndef TNS_R_TARGET also evaluates to true on a
TNS/E platform. In general, you should avoid using #ifndef for conditional
compilation.
A recommended solution is to use the _TANDEM_ARCH macro to distinguish between
platforms for conditional compilation. For example:
#if __TANDEM_ARCH_ =0
printf ("Code intended for TNS");
#endif
#if __TANDEM_ARCH_ =1
printf ("Code intended for TNS/R");
#endif
#if __TANDEM_ARCH_ = 2
printf ("Code intended for TNS/E");
#endif
Native C and C++ Run-Time Library and
Tools.h++ Migration Issues
The TNS/E native C run-time library provides functions conforming to the ISO/ANSI C
Standard. The native C run-time library is nearly identical in the G-series and H-series
RVUs. The main difference is that the H-series library supports new TNS/E C data
types.
The H-series RVUs support two versions of the native C++ run-time library: VERSION2
and VERSION3. VERSION1 is not supported. A C++ program written to use the
VERSION1 library must be updated to use the VERSION2 or VERSION3 library. If you
are currently using the VERSION1 library, you are encouraged to convert to
VERSION3 rather than VERSION2.










