Modifications Required For C Applications
To build C applications byte-aligned with Ingres, a number of files require modification. Any modifications made may need to be re-applied following the installation of an Ingres patch.
The first files to modify are the C header files supplied in the following directories:
II_SYSTEM:[INGRES.DEMO.API.ASC]
II_SYSTEM:[INGRES.DEMO.UDADTS]
II_SYSTEM:[INGRES.FILES]
At this time, the only header files that contain Ingres structure definitions need modification, these are:
II_SYSTEM:[INGRES.DEMO.API.ASC]ASC.H
II_SYSTEM:[INGRES.DEMO.UDADTS]UDT.H
II_SYSTEM:[INGRES.FILES]ABFURTS.H,
II_SYSTEM:[INGRES.FILES]EQSQLCA.H,
II_SYSTEM:[INGRES.FILES]EQSQLDA.H,
II_SYSTEM:[INGRES.FILES]FRAME2.H,
II_SYSTEM:[INGRES.FILES]FRAME60.H,
II_SYSTEM:[INGRES.FILES]FRAME61.H,
II_SYSTEM:[INGRES.FILES]IIADD.H,
II_SYSTEM:[INGRES.FILES]IIAPI.H,
II_SYSTEM:[INGRES.FILES]OSLHDR.H,
II_SYSTEM:[INGRES.FILES]RAAT.H,
II_SYSTEM:[INGRES.FILES]SPATIAL.H
On the first line in each of the above files add:
#pragma member_alignment save
#pragma member_alignment
On the last line in each of the above files add:
#pragma member_alignment restore
Note: The "#" of the #pragma instruction must be the first character on the line.
The purpose of these pragmas is to direct the compiler to naturally align the elements of the defined structures, then to restore the alignment strategy used before the header file was included.
One further change is required to allow Application-By-Forms and Vision applications to successfully build with unaligned code. In II_SYSTEM:[INGRES.FILES]DCC.COM, replace the line
$ cc/standard=vaxc/float=ieee_float/nooptimize/nolist
with:
$ cc/NOMEMBER_ALIGNMENT/GRANULARITY=BYTE -
/standard=vaxc/float=ieee_float/nooptimize/nolist