Pascal Bourguignon reported one year ago (on
2004-12-12) in clisp-list a problem with 64-bit FFI
support. The FFI cannot interface to functions using
[unsigned] long long. This has nothing to do with bug
1385013.
foreign.d says:
#if (long_bitsize<64)
/* 64-bit integers are passed as structs. */
Pascal's example reveals that this is not how long long
(typically 64 bit) is passed (on neither i386 nor Athlon).
His example can easily be turned into a module (attached).
I discovered this issue now only, wondering why CFFI
disabled long-long for CLISP, and took it to
clisp-devel on 2005-12-19. I also posted one message to
clisp-list on 2005-12-22, where I mentioned various
solution path.
My current position is
o expect input & background from Bruno
o introduce ffi:long-long (might be distinct from
uint64, who nows, or just for completeness) (introduces
even more #ifdef sizeof mess)
o base all 64bit code on HAVE_LONGLONG (or 64bit
longs), and error out if not there
o use avcall_longlong for passing longlong (and uint64
on i386 and other 32bit)
There are still some configurations I don't understand
(e.g. probably a 64bit machine whose compiler does not
know longlong, but whose long is 64bits should still
accept uint64 - if such exists).
Regards,
Jörg Höhle
long long test to compile to a module
Logged In: YES
user_id=377168
thank you for your bug report.
the bug has been fixed in the CVS tree.
you can either wait for the next release (recommended)
or check out the current CVS tree (see http://clisp.cons.org\)
and build CLISP from the sources (be advised that between
releases the CVS tree is very unstable and may not even build
on your platform).