[cffi-devel] :uint64 ... how to handle on non-supporting platform ?

Chun Tian (binghe) binghe.lisp at gmail.com
Sat Jan 16 20:49:57 UTC 2010


Hi, Frank

Unlike other CLs, Allegro CL is especially good at using "helper dlls", that is, you create a C function which doesn't use any 64-bit arguments in your own DLL and your function could call any other C library's functions which may have 64-bit arguments. Then you use CFFI to load the helper DLL instead.  Of course you have to handle type coerce from 32-bit to 64-bit by yourself. For example, the "delivery-tag" in your sample could be changed to two 32-bit arguments "delivery-tag_L" and "delivery_tag_H", both of them are typed of :uint32.

CFFI itself is excellent, however Franz (Allegro CL's vendor) is lazy ...

--binghe

在 2010-1-16,21:24, Frank Goenninger 写道:

> Hi -
> 
> thanks to Louis for answering my last question about function pointers.
> 
> I now have a new challenge: How to handle :uint64 when I using  
> AllegroCL 8.1 express edition on Mac OS X when this implementation is  
> not supporting :unsigned-long-long ?
> 
> I do have:
> 
> (defcfun ("amqp_basic_ack" %amqp-basic-ack) :int
>   (state        amqp-connection-state-t)
>   (channel      amqp-channel-t)
>   (delivery-tag :uint64)   ;;;  <<<<<< ----  this is my problem ...
>   (multiple     amqp-boolean-t))
> 
> Could I get around this with a clever padding of the 'multiple'  
> argument ?
> 
> Thanks for any advice!
> 
> Cheers
>   Frank
> 
> 
> 
> 
> _______________________________________________
> cffi-devel mailing list
> cffi-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2603 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20100117/77075a99/attachment.bin>


More information about the cffi-devel mailing list