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

Native C and C++ Migration Tasks
H-Series Application Migration Guide429855-008
5-11
LIBCOBEY and libc.obey Files Replaced
an aid to migrating from VERSION2 to VERSION3. See the C/C++ Programmers
Guide for details.
When migrating to VERSION3 from either VERSION1 or VERSION2, you can omit the
VERSIONn directive (or the -Wversionn flag) when you compile the program because
VERSION3 is the default version. If you are linking the program as a separate step
(rather than allowing the C++ driver to perform the link), you must also specify the
ZCPPCDLL and ZCPP3DLL DLLs on the eld command.
Changing your program so that it does not use Tools.h++ requires additional source
code changes. The changes might be extensive and require a detailed knowledge of
the program. Documentation for these changes is not currently available, but you can
consult the resources described in Section 10, Where to Go for Assistance if you
require assistance.
LIBCOBEY and libc.obey Files Replaced
The run-time libraries required for H-series C and C++ programs are different from
those required for G-series programs. The G-series command files used to link these
libraries— LIBCOBEY (Guardian) and libc.obey (OSS and PC)— are replaced by new
files that list the DLLs required for H-series programs. The names of these new
command files are LIBCTXT (Guardian) and libc.txt (OSS and PC).
See the C/C++ Programmer’s Guide for details.
OSS Programs That Use Pthreads
The Standard POSIX Threads TNS/R shared run-time library, ZSPTSRL, is
implemented as a DLL on TNS/E systems. The DLL name is ZSPTDLL. Both libraries
are located in the current sysnn subvolume.
Beginning with RVU G06.22, T1248 Pthreads supports both the VERSION2 and
VERSION3 C++ libraries. Additionally, take special steps to ensure that exception
handling will continue to function properly. For compiling a TNS/R C++ program
utilizing T1248 and the C++ exception handling mechanism, link the object
/usr/lib/sptcpp.o. This object ensures that exception handling will continue to
work, regardless of the C++ version. However, for programming exclusively in C, or in
C++ on a TNS/E system, linking /usr/lib/sptcpp.o is not necessary.
Using the C++ Neutral Dialect
A new C++ dialect called the neutral C++ dialect is defined for the TNS/E native
environment. This new dialect consists of library components that are common to both
VERSION2 and VERSION3 of the C++ standard library. The C++ neutral dialect is
used on H-series systems by system and middleware libraries so that C++ programs
using either the VERSION2 or VERSION3 library can use the system and middleware
libraries. If you need to create DLLs that can be used by either a VERSION2 or
VERSION3 program, you must use the neutral dialect.
A new pragma and command line option support the neutral C++ dialect: