r9418: rework cmucl/sbcl arrays in deref-array, allocate-foreign-object, and with...
[uffi.git] / src / aggregates.lisp
index 255e226ea70e86574daab2166954577499a1d6af..5c5b5118a88950ea607a21a9f322c6a8c0768adc 100644 (file)
@@ -160,8 +160,14 @@ of the enum-name name, separator-string, and field-name"
 (defmacro deref-array (obj type i)
   "Returns a field from a row"
   #+(or lispworks scl) (declare (ignore type))
-  #+(or cmu scl)  `(alien:deref (the (alien:alien ,(convert-from-uffi-type type :declare)) ,obj) ,i)
-  #+sbcl  `(sb-alien:deref (the (sb-alien:alien ,(convert-from-uffi-type type :declare)) ,obj) ,i)
+  #+(or cmu scl)  `(alien:deref
+                   (alien:cast
+                    ,obj
+                    ,(convert-from-uffi-type type :declare)) ,i)
+  #+sbcl `(sb-alien:deref
+          (sb-alien:cast 
+           ,obj
+           ,(convert-from-uffi-type type :declare)) ,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