[fpc-pascal] How to translate this C header struct to Pascal

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Oct 23 22:21:27 CEST 2009


ik wrote on Fri, 23 Oct 2009:

> You can use bitpacked records:
>
> http://www.google.com/codesearch?hl=en&lr=&q=bitpacked+record+package%3Ahttp%3A%2F%2Fpasxlibbind
> \.googlecode\.com&sbtn=Search
>
> Here is an example on how I use it :)

No, you cannot use bitpacked records for C header translations.  
Bitpacked records are not guaranteed to have the same layout as in C  
(or even in different versions of FPC). If it works, you are lucky,  
and it will probably fail on some other platform or in another FPC  
version one day.

The internal format of bitpacked records is opaque, and it is  
impossible to express the alignment requirements of C bitpacked  
structs or their internal fields with them.


Jonas

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the fpc-pascal mailing list