[C2hs] distributing packages that use C2HS

John Lato jwlato at gmail.com
Tue Jun 24 01:27:02 EDT 2008

On Mon, Jun 23, 2008 at 5:09 PM, Duncan Coutts
<duncan.coutts at worc.ox.ac.uk> wrote:
> On Mon, 2008-06-23 at 12:51 -0500, John Lato wrote:
> In general though it does need to be done on the end users machine so
> it's not just a c2hs limitation.
> You may be lucky and know for certain that for the particular C API that
> you are binding that it is the same on every platform and contains no
> sizes or offsets of types (since sizes and offsets change between
> platforms, especially between 32 and 64bit ones). In that happy
> circumstance then it would be safe to bundle pre-generated .hs files.

Well, thanks for pointing this out.  I'd forgotten that the offsets
will change with platforms, even though one of the reasons I was
attracted to c2hs was because I didn't want to have to worry about
that myself.  Looks like I put that concern a little too far outside
my thoughts!  The API is definitely not the same on every platform.
There can even be size variances on the same platform depending on the
C library's build options, which is yet another item that needs to be
done on the end-users machine.


More information about the C2hs mailing list