Luís Oliveira wrote:
Hello Tian,
On 22/09/2007, Chun Tian (binghe) binghe.lisp@gmail.com wrote:
-+ #-lispworks5 cffi-features:no-long-long
If possible, we should instead use one of the following approaches for checking whether Lispworks has long long support:
some feature keyword symbol specific to long long support, if Lispworks provides any.
check for version 5.0 or higher, presuming all platforms support long long as of version 5.0. (does Lispworks provide something like Allegro's :VERSION>=?)
programmatically check for long long support at read-time, i.e.: (eval-when (<always>) (unless (somehow-check-for-long-long-here) (pushnew 'cffi-features:no-long-long *features*)))
If you could modify the patch to use one of these alternative approaches, that would be great. Thanks.
You're right and I was wrong:
1. It seems that only 64bit LispWorks 5.0 has long-long support, not 32bit, and it's undocumented. 2. the feature :lispworks-32bit does not exist in versions prior to 5.0, so I cannot use it to detect FOREIGN-TYPED-AREF.
The long-long support maybe detect using (fli::64bit-long-p), I found this function in both 4.4 and 5.0 version of lispworks. So I think maybe these #+lispworks5 and #-lispworks5 can be replaced with #+#.(cl:if (fli::64bit-long-p) '(and) '(or)), etc.
Another problem is that LispWorks's FOREIGN-TYPED-AREF cannot accept the type | (unsigned-byte 64)| and |(signed-byte 64) now, though people from LispWorks, Ltd say they will support this in next version. It's quite hard for me to give a patch which can still use other type on |FOREIGN-TYPED-AREF on platform support long-long, and this patch should also consider the future version of lispworks which can support | (unsigned-byte 64)| and |(signed-byte 64).
And, I think |Lispworks didn't provide something like Allegro's :VERSION>=?), but seems LispWorks put its version in *features*, and LispWorks's version change is much small than Allegro, so the same detect maybe done with combined #+.
If Martin Simmons see this post, I hope he can give us a better answer. | Thanks.
|Chun Tian (binghe)