cffi-devel  

Re: [cffi-devel] detecting int size used by library

Stelian Ionescu
Wed, 26 May 2010 09:48:49 -0700

On Wed, 2010-05-26 at 11:42 +0000, Tamas K Papp wrote:
> Hi,
> 
> Is there a way to detect the size of integers (ie 32 or 64 bit) used
> by a library?
> 
> I am using LAPACK/BLAS (ATLAS) libraries via CFFI.  Recently, my
> tests failed, and to my surprise, the solution was to use 32-bit ints.
> Note that I am on a 64-bit platform, using the Ubuntu libraries, so
> why this happens is a mystery. 

Linux uses the LP64 data model, in which ints are 32bit:
http://en.wikipedia.org/wiki/64-bit#Specific_C-language_data_models


>  But it would be great if I could detect it somehow from within Lisp.

cffi:foreign-type-size will return the size of the builtin types

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
http://common-lisp.net/project/iolib

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel