H-Series Application Migration Guide (H06.07+, J06.03+)
Native C and C++ Migration Tasks
H-Series Application Migration Guide—429855-008
5-5
Check Use of Feature Test Macro
unsigned short int *array;
}arg
union semun semopts;
semopts.val = 1;
if (semctl(semid, 0, SETVAL, semopts) ==-1)
On TNS/R systems, you can also pass a value directly, without the use of the semun
union (for example, as a simple scalar), as in this example:
if (semctl(semid, 0, SETVAL, 1) ==1)
A value passed in this way gives the expected results.
However, on TNS/E systems, you must define the parameter value as a semun union.
Code that does not do so will not function as expected.
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
Value Platform
0TNS
1TNS/R
2TNS/E










