[Openmcl-cvs-notifications] r10493 - /trunk/source/lib/ffi-darwinx8632.lisp

gb at clozure.com gb at clozure.com
Tue Aug 19 06:20:19 EDT 2008


Author: gb
Date: Tue Aug 19 06:20:19 2008
New Revision: 10493

Log:
Pass small (<=3D 32 bits) structures by value.

Modified:
    trunk/source/lib/ffi-darwinx8632.lisp

Modified: trunk/source/lib/ffi-darwinx8632.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lib/ffi-darwinx8632.lisp (original)
+++ trunk/source/lib/ffi-darwinx8632.lisp Tue Aug 19 06:20:19 2008
@@ -65,8 +65,12 @@
 	      (progn
 		(argforms arg-type-spec)
 		(argforms arg-value-form))
-	      (let* ((ftype (parse-foreign-type arg-type-spec)))
-		(argforms (foreign-type-to-representation-type ftype))
+	      (let* ((ftype (parse-foreign-type arg-type-spec))
+                     (bits (ensure-foreign-type-bits ftype)))
+                (if (and (typep ftype 'foreign-record-type)
+                         (<=3D bits 32))
+                  (argforms (ceiling bits 32))
+                  (argforms (foreign-type-to-representation-type ftype)))
 		(argforms (funcall arg-coerce arg-type-spec arg-value-form))))))
 	  (argforms (foreign-type-to-representation-type result-type))
 	  (let* ((call (funcall result-coerce result-type-spec `(, at callform ,@(ar=
gforms)))))



More information about the Openmcl-cvs-notifications mailing list