TNS/R Native Application Migration Guide
Shared Data Migration Tasks
TNS/R Native Application Migration Guide—523745-001
11-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 C and C++
programs on TNS/R systems by default (pragma FIELDALIGN AUTO). The pTAL
compiler aligns data for the optimal performance of pTAL programs on TNS/R systems
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 Native Programs on page 11-1
instead.