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

ik idokan at gmail.com
Sat Oct 24 01:26:54 CEST 2009


That's make this feature very not useful and unneeded.

If I have a C struct that has a non standard bit count, how can I make sure
that I'll have the needed data on the right field, and without any segfult
in the middle ?

Doesn't Pascal have something to offer me to deal with it ?

Ido

http://ik.homelinux.org/


On Fri, Oct 23, 2009 at 10:21 PM, Jonas Maebe <jonas.maebe at elis.ugent.be>wrote:

> 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.
>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20091024/54ce500f/attachment.html>


More information about the fpc-pascal mailing list