r9575: fix WITH-FOREIGN-OBJECT macro for cmu
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 10 Jun 2004 06:18:06 +0000 (06:18 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 10 Jun 2004 06:18:06 +0000 (06:18 +0000)
debian/changelog
src/aggregates.lisp
src/objects.lisp

index 295401cfb54994c90f87b9c677774bc75ba1dc87..192408aa8be9f5b868652e4be58a119f3f0cdee1 100644 (file)
@@ -1,3 +1,9 @@
+cl-uffi (1.4.21-1) unstable; urgency=low
+
+  * Fix for WITH-FOREIGN-OBJECT macro on CMUCL
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Thu, 10 Jun 2004 00:17:31 -0600
+
 cl-uffi (1.4.20-1) unstable; urgency=low
 
   * New upstream
index 523bd4f72983eadee80b0aa91ef86c6e3bae09ca..70d3ad264c687abdd7374ffb22e0075f23094572 100644 (file)
@@ -161,7 +161,7 @@ of the enum-name name, separator-string, and field-name"
   "Returns a field from a row"
   #+(or lispworks cmu sbcl scl) (declare (ignore type))
   #+(or cmu scl)  `(alien:deref ,obj ,i)
-  #+sbcl  `(sb-alien:deref ,obj ,i)
+  #+sbcl `(sb-alien:deref ,obj ,i)
   #+lispworks `(fli:dereference ,obj :index ,i :copy-foreign-object nil)
   #+allegro `(ff:fslot-value-typed (quote ,(convert-from-uffi-type type :type)) :c ,obj ,i)
   #+openmcl
index 9de66f9767a4c3495e6eeef54910a0180fdc2d8c..57611321ff93a71458ce00d1db6a5ed621063a45 100644 (file)
@@ -166,10 +166,15 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated."
         (progn ,@body)
       (free-foreign-object ,var)))
   #+(or cmu scl)
-  (let ((obj (gensym)))
-    `(alien:with-alien ((,obj ,(convert-from-uffi-type (eval type) :allocate)))
-       (let ((,var (alien:addr ,obj)))
-        ,@body)))
+  (let ((obj (gensym))
+       (ctype (convert-from-uffi-type (eval type) :allocate)))
+    (if (and (consp ctype) (eq 'array (car ctype)))
+       `(alien:with-alien ((,obj ,ctype))
+         (let* ((,var ,obj))
+           ,@body))
+       `(alien:with-alien ((,obj ,ctype))
+         (let* ((,var (alien:addr ,obj)))
+           ,@body))))
   #+sbcl
   (let ((obj (gensym))
        (ctype (convert-from-uffi-type (eval type) :allocate)))