[cffi-devel] detecting int size used by library

Stelian Ionescu sionescu at cddr.org
Wed May 26 12:40:01 UTC 2010


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20100526/f99b09d5/attachment.sig>


More information about the cffi-devel mailing list