TNS/E Native Application Conversion Guide

TNS/E Native Application Conversion Guide529659-003
9-1
9
Converting Programs That Share
Data
This section describes the conversion tasks related to:
Sharing Data Between TNS and TNS/E Native Programs
Sharing Data Between pTAL Programs and Native C or C++ Programs on
page 9-2
Shared data objects can include parameters, structures, messages, database entries,
and disk records.
Sharing Data Between TNS and TNS/E Native
Programs
The native compilers align data for optimal performance on the TNS/E platform by
default. This default alignment is different and incompatible with the default data
alignment generated by the TNS compilers.
Because of this incompatibility, data objects shared between native programs and TNS
programs require FIELDALIGN SHARED2 pragmas for C and C++ and FIELDALIGN
SHARED2 directives for TAL and pTAL. These pragmas and directives cause both
TNS and native compilers to generate code with the same alignment.
FIELDALIGN SHARED2 produces code that is not optimally aligned for the TNS/E
platform. Therefore, specify FIELDALIGN SHARED2 only for shared data objects.
Otherwise, use the default native compiler alignment.
See the
C/C++ Programmer’s Guide
or the
pTAL Reference Manual
for more
information on controlling data alignment.
D-series, G-series, and H-series versions of the TAL compiler support FIELDALIGN
directives. D4x, G-series, and H-series versions of the TNS C compiler support
FIELDALIGN pragmas. Pre-D40 product versions of the TNS C compiler require these
PVUs to support FIELDALIGN pragmas:
Note. If DDL is used to define shared data objects and generate source code, see Section 7,
Converting Data Definition Language (DDL).
For this TNS C compiler product version Use a PVU version of at least
T9255D20 T9255ABN
T9255D30 T9255ABM
T8377D30 T8377AAA