r10350: 2005-03-03 Kevin Rosenberg (kevin@rosenberg.net)
authorKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 2 Mar 2005 19:25:59 +0000 (19:25 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 2 Mar 2005 19:25:59 +0000 (19:25 +0000)
        * src/primitives.lisp: Add support for :union types
        [patch from Cyrus Harmon]
        * tests/union.lisp, tests/structs.lisp: Tests for
        union and structure types [from Cyrus Harmon]

ChangeLog
debian/changelog
src/primitives.lisp
tests/structs.lisp
tests/union.lisp

index 46eba703f23216071db15b56aab0af370185eb69..07551187fd717f0f4fe5c7284a0365a5f69e1dc7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-03 Kevin Rosenberg (kevin@rosenberg.net)
+       * src/primitives.lisp: Add support for :union types
+       [patch from Cyrus Harmon]
+       * tests/union.lisp, tests/structs.lisp: Tests for
+       union and structure types [from Cyrus Harmon]
+       
 2005-02-22 Kevin Rosenberg (kevin@rosenberg.net)
        * src/primitives.lisp, src/strings.lisp: Better support 
        for sb-unicode [from Yoshinori Tahara and R. Mattes]
index e6750de88547f80069c876989e3a946f57339867..d20f5b0ea2dcf722320299cc429af3ba5e9be098 100644 (file)
@@ -1,3 +1,9 @@
+cl-uffi (1.4.33-1) unstable; urgency=low
+
+  * New upstream
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Wed,  2 Mar 2005 12:25:43 -0700
+
 cl-uffi (1.4.32-1) unstable; urgency=low
 
   * New upstream
index 5522f5a73e55e79f4baea4a7d0e844d46357d53b..0f47eb70b2d104134d9d354d4ee193481f5fc0d8 100644 (file)
@@ -272,9 +272,13 @@ supports takes advantage of this optimization."
         #+mcl `(:struct ,(%convert-from-uffi-type (cadr type) :struct))
         #-mcl (%convert-from-uffi-type (cadr type) :struct)
         )
-       (t
-        (cons (%convert-from-uffi-type (first type) context) 
-              (%convert-from-uffi-type (rest type) context)))))))
+       (:union
+       #+mcl `(:union ,(%convert-from-uffi-type (cadr type) :union))
+       #-mcl (%convert-from-uffi-type (cadr type) :union)
+       )
+       (t
+       (cons (%convert-from-uffi-type (first type) context) 
+             (%convert-from-uffi-type (rest type) context)))))))
 
 (defun convert-from-uffi-type (type context)
   (let ((result (%convert-from-uffi-type type context)))
index 6eb7577d4a3438a1b270fe2b05793793b53435f5..20338d4ded85321dfbe3ce57cb6f5143728e475b 100644 (file)
@@ -29,3 +29,8 @@
     t)
   t)
 
+(deftest structs.2
+    (progn
+      (uffi:def-foreign-type foo-struct (:struct foo))
+      t)
+  t)
index 86e8627ee0e925727b98c836879bc1aaabe2979d..584d563e686652e44280f790235ce56d3f1f5526 100644 (file)
 (deftest union.3 (plusp (uffi:get-slot-value *u* 'tunion1 'uint)) t)
 
 
+(uffi:def-union foo-u
+    (bar :pointer-self))
+
+(uffi:def-foreign-type foo-u-ptr (* foo-u))
+
+;; tests that compilation worked
+(deftest unions.4 
+  (with-foreign-object (p 'foo-u)
+    t)
+  t)
+
+(deftest unions.5
+    (progn
+      (uffi:def-foreign-type foo-union (:union foo-u))
+      t)
+  t)
+
+
+