On Wed, May 26, 2010 at 1:42 PM, Tamas K Papp <tkp...@gmail.com> wrote:

> Is there a way to detect the size of integers (ie 32 or 64 bit) used
> by a library?
>

The point is that you cannot even detect it so simply in C. If the library
is FORTRAN then you definitely have to introduce the knowledge of the type
size "by hand", because different compilers and different compiler options
will force the use of different type sizes.

If the library is in C and you have access to the headers then maybe
cffi-grovel can traverse the header and find it out, but I am not familiar
enough with that component and its preprocessing abilities (Atlas is likely
to use #defines and #ifdefs to choose the appropriate size).

Otherwise the usual and most reliable way to detect it is to do something
like autoconf does, which is to create a tiny C program, compile it with the
same flags as the library and detect the type size. You may even automate
this from lisp.

Juanjo

-- 
Instituto de FĂ­sica Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://tream.dreamhosters.com
_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to