On Wed, Apr 15, 2009 at 12:59 AM, Jean-Claude Beaudoin
<jean.claude.beaud...@gmail.com> wrote:
>
> One of the main new features of ECL 9.4 is its support for C type "long long" 
> on Intel x86.
>
> Here is a patch against CFFI 0.10.4 that gives access to this long awaited 
> foreign type.

I tried your patch on x86-64 and it fails a lot of the "long long"
tests. Did you run the test suite?

16 out of 192 total tests failed: FUNCALL.LONG-LONG,
FUNCALL.VARARGS.DOUBLE, DEFCFUN.LONG-LONG,
   DEFCFUN.NOOP, DEFCFUN.VARARGS.FLOAT, DEFCFUN.VARARGS.DOUBLE,
   FOREIGN-GLOBALS.REF.LONG-LONG, FOREIGN-GLOBALS.SET.LONG-LONG,
   DEREF.LONG-LONG, DEREF.UNSIGNED-LONG-LONG, DEREF.NONCONST.LONG-LONG,
   DEREF.NONCONST.UNSIGNED-LONG-LONG, STRING.ENCODING.UTF-16.BASIC,
   STRING.ENCODINGS.ALL.BASIC, MISC-TYPES.STRING+PTR,
   MISC-TYPES.WRAPPER.

Had to disable the callback tests altogether. (In any case, ECL says
it doesn't long-long for callback return types.) I've attached the
patch I used.

--
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
diff -rN -u old-cffi/cffi-tests.asd new-cffi/cffi-tests.asd
--- old-cffi/cffi-tests.asd	2009-04-15 17:19:46.000000000 +0100
+++ new-cffi/cffi-tests.asd	2009-04-15 17:19:46.000000000 +0100
@@ -63,7 +63,7 @@
      (:file "bindings")
      (:file "funcall")
      (:file "defcfun")
-     (:file "callbacks")
+     #-ecl (:file "callbacks")
      (:file "foreign-globals")
      (:file "memory")
      (:file "strings")
diff -rN -u old-cffi/src/cffi-ecl.lisp new-cffi/src/cffi-ecl.lisp
--- old-cffi/src/cffi-ecl.lisp	2009-04-15 17:19:46.000000000 +0100
+++ new-cffi/src/cffi-ecl.lisp	2009-04-15 17:19:46.000000000 +0100
@@ -60,7 +60,8 @@
 
 ;;;# Mis-features
 
-(pushnew 'no-long-long *features*)
+#-uint64-t (pushnew 'no-long-long *features*)
+(pushnew 'no-stdcall *features*)
 (pushnew 'flat-namespace *features*)
 
 ;;;# Symbol Case
@@ -179,8 +180,12 @@
     (:unsigned-int    :unsigned-int    "unsigned int")
     (:long            :long            "long")
     (:unsigned-long   :unsigned-long   "unsigned long")
-    #+x86-64 (:long-long :long "long long")
-    #+x86-64 (:unsigned-long-long :unsigned-long "unsigned long long")
+    #+(and x86-64 (not uint64-t)) #+(and x86-64 (not uint64-t))
+    (:long-long       :long            "long long")
+    (:unsigned-long-long :unsigned-long "unsigned long long")
+    #+uint64-t #+uint64-t
+    (:long-long       :long-long       "long long")
+    (:unsigned-long-long :unsigned-long-long "unsigned long long")
     (:float           :float           "float")
     (:double          :double          "double")
     (:pointer         :pointer-void    "void*")
diff -rN -u old-cffi/tests/callbacks.lisp new-cffi/tests/callbacks.lisp
--- old-cffi/tests/callbacks.lisp	2009-04-15 17:19:46.000000000 +0100
+++ new-cffi/tests/callbacks.lisp	2009-04-15 17:19:46.000000000 +0100
@@ -81,7 +81,8 @@
     ((a :unsigned-long) (b :unsigned-long))
   (+ a b))
 
-#-cffi-sys::no-long-long
+;; ECL doesn't support :LONG-LONG for callbacks.
+#-(or ecl cffi-sys::no-long-long)
 (progn
   (defcallback sum-long-long :long-long
       ((a :long-long) (b :long-long))
@@ -473,6 +474,7 @@
 
 #-cffi-sys::no-foreign-funcall
 (deftest callbacks.float26.funcall
+    #+ecl nil #-ecl
     (foreign-funcall-pointer
      (callback float26) () :float 5.0 :float 5.0
      :float 5.0 :float 5.0 :float 5.0 :float 5.0
diff -rN -u old-cffi/tests/misc-types.lisp new-cffi/tests/misc-types.lisp
--- old-cffi/tests/misc-types.lisp	2009-04-15 17:19:46.000000000 +0100
+++ new-cffi/tests/misc-types.lisp	2009-04-15 17:19:46.000000000 +0100
@@ -30,6 +30,7 @@
 (defcfun ("my_strdup" strdup) :string+ptr (str :string))
 
 (deftest misc-types.string+ptr
+    #+ecl nil #-ecl
     (destructuring-bind (string pointer)
         (strdup "foo")
       (foreign-free pointer)
@@ -122,6 +123,7 @@
   (str funky-string))
 
 (deftest misc-types.wrapper
+    #+ecl nil #-ecl
     (destructuring-bind (string ptr)
         (funky-strdup "code")
       (foreign-free ptr)

_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to