James Bielman wrote:
Could you please confirm my supposition that long-long works out of the box with clisp on your amd64 machine?
How would I go about testing this? I don't see a LONG-LONG type in the FFI package (or do I need a CVS version? I'm using the latest release).
Map cffi:long-long to ffi:sint64 and ffi:uint64. I have not added an ffi:long-long type. Not ideal, but good enough.
I've now updated CVS CLISP to support interfacing to a 64bit "long long" entity on all platforms where some 64bit type is available (e.g. gcc, MS-VC).
In other words, cffi-features:no-long-long should be removed from cffi-clisp (or you may wish to conditionalize on the version number or whatever, but that's too restrictive since e.g. I'm convinced that ffi:uint64 has always worked on 64bit machines, where long=long long)).
Please test & report if it fails.
Furthermore, I think you need to think about what CFFI should do e.g. on the MS-VC platform. It does not have a "long long", it's called __int64 instead. But this is a 64bit type (and possibly some system structures or libraries use that, I don't know). CLISP's ffi:uint64 works with __int64.
Actually, given my tests, I'd not recommend trying to call MS-VC __int64 receiving or returning functions via gcc long long or vice-versa. They may have incompatible calling conventions (speculation, but MS-VC6 has a different one from GCC4 on Linux/i686. I haven't tested cygwin/mingw). Pointers to such 64bit ints are no problem at all.
Regards, Jorg Hohle.
"Hoehle, Joerg-Cyril" Joerg-Cyril.Hoehle@t-systems.com writes:
Map cffi:long-long to ffi:sint64 and ffi:uint64. I have not added an ffi:long-long type. Not ideal, but good enough.
I've now updated CVS CLISP to support interfacing to a 64bit "long long" entity on all platforms where some 64bit type is available (e.g. gcc, MS-VC).
In other words, cffi-features:no-long-long should be removed from cffi-clisp (or you may wish to conditionalize on the version number or whatever, but that's too restrictive since e.g. I'm convinced that ffi:uint64 has always worked on 64bit machines, where long=long long)).
Please test & report if it fails.
Hmm, I've tried to install an x86 CLISP in a 32-bit chroot to prepare to implement and test this, but I'm a little concerned about the fact that MACHINE-TYPE still returns X86-64 on a 32-bit x86 build. Is there a better way to tell whether we are running an x86 or x86-64 CLISP?
James