[cffi-devel] About long-long support in AMD64 LispWorks

Chun Tian (binghe) binghe.lisp at gmail.com
Wed Jun 6 22:02:48 UTC 2007


Hi, Martin

Sorry, after trying (fli:size-of '(:long :long)), I found that my
LispWorks already support long-long foreign type.
I think I should just remove cffi-features:no-long-long feature in
cffi-lispworks.lisp, at least for my personal use.

By the way, with some trivial changes, I can compile the whole iolib
package (heavily depends on cffi) in amd64 lispworks now.

Thank for point out this.

Martin Simmons wrote:
>>>>>> On Thu, 07 Jun 2007 01:48:27 +0800, Chun Tian (binghe) said:
>>>>>>             
>> Hi, CFFI Developers
>>
>> I found that in AMD64 Linux, the long and long long type are both 8
>> bytes. Can I directly map CFFI's :long-long into LispWorks FLI's :long
>> type to get support for long-long type? (This is need when I compile
>> iolib package in amd64 LispWorks):
>>
>> cffi-lispworks.lisp:
>>
>> (defun convert-foreign-type (cffi-type)
>>   "Convert a CFFI type keyword to an FLI type."
>>   (ecase cffi-type
>>     (:char            :byte)
>>     (:unsigned-char   '(:unsigned :byte))
>>     (:short           :short)
>>     (:unsigned-short  '(:unsigned :short))
>>     (:int             :int)
>>     (:unsigned-int    '(:unsigned :int))
>>     (:long            :long)
>>     (:unsigned-long   '(:unsigned :long))
>>     #+amd64
>>     (:long-long       :long)
>>     #+amd64
>>     (:unsigned-long-long '(:unsigned :long))
>>     (:float           :float)
>>     (:double          :double)
>>     (:pointer         :pointer)
>>     (:void            :void)))
>>     
>
> This is not quite right -- it should use the type long-long on the right-hand
> side.  Also, it may be better to do this unconditionally, so it works on any
> LispWorks platform that supports it.
>
>   




More information about the cffi-devel mailing list