Hi,
I get the following error
Error: :LONG-LONG fell through ECASE expression.
Wanted one of (:CHAR :UNSIGNED-CHAR :SHORT :UNSIGNED-SHORT :INT :UNSIGNED-INT :LONG :UNSIGNED-LONG :FLOAT :DOUBLE :POINTER :VOID).
when I try
(defcfun sqlite3-last-insert-rowid :int64
(db p-sqlite3))
I think :in64 or :long-long is emulated on 32-bit Lispworks?
What should I do? The function works, if I use :int32, but I wonder why.
Any hint or help appreciated.
Regards
Andreas
Just no long-long support in 32-bit LispWorks FLI. This also cause IOlib not work on all 32-bit LispWorks (on Linux, Mac OS, ...)
On 2009-3-1, at 21:22, Andreas Thiele wrote:
Hi,
I get the following error
Error: :LONG-LONG fell through ECASE expression. Wanted one of (:CHAR :UNSIGNED-CHAR :SHORT :UNSIGNED- SHORT :INT :UNSIGNED-INT :LONG :UNSIGNED- LONG :FLOAT :DOUBLE :POINTER :VOID).
when I try
(defcfun sqlite3-last-insert-rowid :int64 (db p-sqlite3))
I think :in64 or :long-long is emulated on 32-bit Lispworks?
What should I do? The function works, if I use :int32, but I wonder why.
Any hint or help appreciated.
Regards Andreas _______________________________________________ cffi-devel mailing list cffi-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
-- Chun Tian (binghe) NetEase.com, Inc. P. R. China
On Mon, 2 Mar 2009 00:33:19 +0800, Chun Tian (binghe) said:
Just no long-long support in 32-bit LispWorks FLI. This also cause IOlib not work on all 32-bit LispWorks (on Linux, Mac OS, ...)
That's not quite true. The FLI in 32-bit LispWorks 5.1 supports the long-long type for foreign function arguments and return values.
See http://www.mail-archive.com/cffi-devel@common-lisp.net/msg01174.html
On 2009-3-1, at 21:22, Andreas Thiele wrote:
Hi,
I get the following error
Error: :LONG-LONG fell through ECASE expression. Wanted one of (:CHAR :UNSIGNED-CHAR :SHORT :UNSIGNED- SHORT :INT :UNSIGNED-INT :LONG :UNSIGNED- LONG :FLOAT :DOUBLE :POINTER :VOID).
when I try
(defcfun sqlite3-last-insert-rowid :int64 (db p-sqlite3))
I think :in64 or :long-long is emulated on 32-bit Lispworks?
What should I do? The function works, if I use :int32, but I wonder why.
Any hint or help appreciated.
Regards Andreas _______________________________________________ cffi-devel mailing list cffi-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
-- Chun Tian (binghe) NetEase.com, Inc. P. R. China
cffi-devel mailing list cffi-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
Hi, Martin
Thanks for clarifying. I've found your last comments:
""" Support for :long-long is available in the LispWorks 5.0 FLI: - On all 64-bit platforms. - For FLI:DEFINE-FOREIGN-FUNCTION on all 32-bit platforms.
It is not avaliable in: - LispWorks 4. - For data access functions such as FLI:DEREFERENCE on 32-bit platforms.
Because of this last restriction, if CFFI wants to support :long- long on 32-bit LispWorks platforms, then it can do it for DEFCFUN but not other APIs. A single cffi-feature is not enough to describe this, so it could just support it on 64-bit platforms by using #-lispworks-64bit to enable cffi-features:no-long-long. """
(And the bug in FOREIGN-TYPED-AREF last time we talked has been fixed in LispWorks 5.1)
Current CFFI code just set a "no-long-long" feature on 32-bit lispworks, and I agree that a single cffi feature is not enough to describe this. Let me see what else I can do. I need IOlib on 32-bit LispWorks.
--binghe
On 2009-3-2, at 20:32, Martin Simmons wrote:
On Mon, 2 Mar 2009 00:33:19 +0800, Chun Tian (binghe) said:
Just no long-long support in 32-bit LispWorks FLI. This also cause IOlib not work on all 32-bit LispWorks (on Linux, Mac OS, ...)
That's not quite true. The FLI in 32-bit LispWorks 5.1 supports the long-long type for foreign function arguments and return values.
See http://www.mail-archive.com/cffi-devel@common-lisp.net/msg01174.html
On 2009-3-1, at 21:22, Andreas Thiele wrote:
Hi,
I get the following error
Error: :LONG-LONG fell through ECASE expression. Wanted one of (:CHAR :UNSIGNED-CHAR :SHORT :UNSIGNED- SHORT :INT :UNSIGNED-INT :LONG :UNSIGNED- LONG :FLOAT :DOUBLE :POINTER :VOID).
when I try
(defcfun sqlite3-last-insert-rowid :int64 (db p-sqlite3))
I think :in64 or :long-long is emulated on 32-bit Lispworks?
What should I do? The function works, if I use :int32, but I wonder why.
Any hint or help appreciated.
Regards Andreas _______________________________________________ cffi-devel mailing list cffi-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
-- Chun Tian (binghe) NetEase.com, Inc. P. R. China
cffi-devel mailing list cffi-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
-- Martin Simmons LispWorks Ltd http://www.lispworks.com/
-- Chun Tian (binghe) NetEase.com, Inc. P. R. China
"Chun Tian (binghe)" binghe.lisp@gmail.com writes: [...]
Current CFFI code just set a "no-long-long" feature on 32-bit lispworks, and I agree that a single cffi feature is not enough to describe this. Let me see what else I can do. I need IOlib on 32-bit LispWorks.
For an old project using Lispworks I simply commented out the few iolib features that use 64-bit and we were able to get TCP/IP networking up and running rather easily on both Linux and FreeBSD.
Perhaps you can persuade iolib to automatically disable them or use the OS's 32-bit APIs on Lisps with crippled FFIs.
If you want more powerful access to UDP, let me recommend again my CFFI UDP library, which works fine on Lispworks 32-bit ;-)
[...]
В сообщении от Sunday 01 of March 2009 16:22:53 Andreas Thiele написал(а):
Hi,
I get the following error
Error: :LONG-LONG fell through ECASE expression.
Wanted one of (:CHAR :UNSIGNED-CHAR :SHORT :UNSIGNED-SHORT :INT
:UNSIGNED-INT :LONG :UNSIGNED-LONG :FLOAT :DOUBLE :POINTER :VOID).
when I try
(defcfun sqlite3-last-insert-rowid :int64
(db p-sqlite3))
I think :in64 or :long-long is emulated on 32-bit Lispworks?
What should I do? The function works, if I use :int32, but I wonder why.
Any hint or help appreciated.
I think that in this case it is necessary to create a glue library in C that would return the 64-bit value as two 32-bit values:
void sqlite3_last_insert_rowid_1(sqlite3* db, uint32_t* high_part, uint32_t* low_part);
I've looked into CLSQL documentation, and CLSQL uses this approach.