[cffi-devel] Lisp type for word size

Martin Simmons martin at lispworks.com
Mon Oct 25 17:43:45 UTC 2010


>>>>> On Mon, 25 Oct 2010 17:21:20 +0200, Tobias C Rittweiler said:
> 
> Does CFFI contain a Lisp type which represents the
> machine's word size?
> 
> I guess it could be defined as
> 
>   (deftype word-size ()
>     `(unsigned-byte ,(* 8 (foreign-type-size :long))))
> 

Using :pointer instead of :long would be better (long is 32-bit on 64-bit
Windows).


> Are there any caveats? E.g. what about a 32bit Lisp
> implementation on a 64bit architecture?

That should be OK in general, because almost all 64-bit OSes run 32-bit
programs in a 32-bit address space (i.e. as if the OS is 32-bit).

__Martin




More information about the cffi-devel mailing list