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

Native C and C++ Migration Tasks
H-Series Application Migration Guide429855-006
5-10
LIBCOBEY and libc.obey Files Replaced
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 obey 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 obey
files are LIBTXT (Guardian) and lib.txt (OSS and PC).
See the C/C++ Programmers 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:
NEUTRAL (pragma)
BUILD_NEUTRAL_LIBRARY (command line option)
The NEUTRAL pragma is used within headers supplied by HP to mark an object as
being sharable between VERSION2 and VERSION3 of the standard library.
The BUILD_NEUTRAL_LIBRARY option enables you to create a DLL that uses the
neutral dialect. This option causes the compiler to check whether or not a compilation
will create a DLL that can use the neutral dialect. The C++ compiler generates an error
if BUILD_NEUTRAL_LIBRARY is specified and the program references an object not
marked with NEUTRAL.