TNS/E Native Application Conversion Guide
Converting Programs That Share Data
TNS/E Native Application Conversion Guide—529659-003
9-2
Sharing Data Between pTAL Programs and Native C
or C++ Programs
Sharing Data Between pTAL Programs and
Native C or C++ Programs
The native C and C++ compilers align data for the optimal performance of C and C++
programs on the TNS/E platform by default (pragma FIELDALIGN AUTO). The pTAL
compiler aligns data for the optimal performance of pTAL programs on the TNS/E
platform by default (directive FIELDALIGN AUTO). Although the default setting of the
pTAL, C, and C++ compilers is FIELDALIGN AUTO, the compilers generate different
and incompatible alignments for FIELDALIGN AUTO.
Because of this data alignment incompatibility, data objects shared between pTAL
programs and native C or C++ programs require FIELDALIGN SHARED8 pragmas for
C and C++ and FIELDALIGN SHARED8 directives for pTAL. This pragma and directive
cause the native compilers to generate code with the same alignment.
Instead of using FIELDALIGN SHARED8, you can also use FIELDALIGN PLATFORM
for programs that do not contain pTAL WADDR, BADDR, or EXTADDR address types
in structures.
If the data objects are also shared with TNS programs, use the pragmas and directives
described under Sharing Data Between TNS and TNS/E Native Programs on page 9-1
instead.










