We are running into a real problem while porting the Apple Pascal Interfaces to gpc.
Consider the following record definition:
type word16 = cardinal( 16); word32 = cardinal( 32); rec = record a: word16; b: word32 end;
For binary compatibility, the size of the 'rec' type must be 6 rather than 8.
Section 7.2.16 of the gpc manual reads as follows:
"GPC by default aligns fields of records and arrays suitably for higher performance, while BP doesn’t. If you don’t want the alignment (e.g., because the program relies on the internal format of your structures), either declare the relevant structures as ‘packed’ (which BP also accepts, but ignores), or give the ‘--pack-struct’ option."
Now, the problem is:
(1) --pack-struct doesn't seem to be available as a source code compiler option. (2) adding 'packed' to records makes it impossible to pass any field of the record as an actual 'var' parameter.
For these two reasons I have an urgent feature request, which is to make --pack-struct available as a compiler option that can be added to the Pascal source code.
Regards,
Adriaan van Os