[cffi-devel] [PATCH] Adding support for 64 bits types on CLISP > 2.38

Frédéric Jolliton cffi-devel at frederic.jolliton.com
Mon Jun 26 01:24:25 UTC 2006


Hi,

Here is a trivial patch to enable 64 bits types on a recent CLISP
version (newer than 2.38).

I tested the latest CVS version, on Linux 2.6 x86-32. All the tests
pass.

However, I don't know how to test for the CLISP version to enable
conditionally this support, because while at least CLISP 2.38 support
ffi:uint64 and ffi:sint64 for function call parameters, it doesn't for
return value of this type (it's accepted, but we get a random value.)

--- cffi_0.9.1.orig/src/cffi-clisp.lisp	2006-04-11 22:02:54.000000000 +0200
+++ cffi_0.9.1/src/cffi-clisp.lisp	2006-06-26 02:46:01.000000000 +0200
@@ -63,7 +63,6 @@
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (mapc (lambda (feature) (pushnew feature *features*))
         '(;; Backend mis-features.
-          cffi-features:no-long-long
           ;; OS/CPU features.
           #+macos  cffi-features:darwin
           #+unix   cffi-features:unix
@@ -96,6 +95,8 @@
     (:unsigned-int 'ffi:uint)
     (:long 'ffi:long)
     (:unsigned-long 'ffi:ulong)
+    (:long-long 'ffi:sint64)
+    (:unsigned-long-long 'ffi:uint64)
     (:float 'ffi:single-float)
     (:double 'ffi:double-float)
     ;; Clisp's FFI:C-POINTER converts NULL to NIL. For now

-- 
Frédéric Jolliton



More information about the cffi-devel mailing list