Index: /trunk/ccl/lib/ffi-linuxppc32.lisp
===================================================================
--- /trunk/ccl/lib/ffi-linuxppc32.lisp	(revision 5759)
+++ /trunk/ccl/lib/ffi-linuxppc32.lisp	(revision 5760)
@@ -37,5 +37,5 @@
 
 
-(defun linux32::expand-ff-call (callform args)
+(defun linux32::expand-ff-call (callform args &key (arg-coerce #'null-coerce-foreign-arg) (result-coerce #'null-coerce-foreign-result))
   (let* ((result-type-spec (or (car (last args)) :void))
          (enclosing-form nil)
@@ -62,5 +62,5 @@
         (unless (evenp (length args))
           (error "~s should be an even-length list of alternating foreign types and values" args))        
-                (do* ((args args (cddr args)))
+        (do* ((args args (cddr args)))
              ((null args))
           (let* ((arg-type-spec (car args))
@@ -79,7 +79,7 @@
                   (progn
                     (argforms (foreign-type-to-representation-type ftype))
-                    (argforms arg-value-form)))))))
+                    (argforms (funcall arg-coerce arg-type-spec arg-value-form))))))))
         (argforms (foreign-type-to-representation-type result-type))
-        (let* ((call `(,@callform ,@(argforms))))
+        (let* ((call (funcall result-coerce result-type-spec `(,@callform ,@(argforms)))))
           (if enclosing-form
             `(,@enclosing-form ,call)
Index: /trunk/ccl/lib/ffi-linuxppc64.lisp
===================================================================
--- /trunk/ccl/lib/ffi-linuxppc64.lisp	(revision 5759)
+++ /trunk/ccl/lib/ffi-linuxppc64.lisp	(revision 5760)
@@ -36,5 +36,5 @@
       (typep ftype 'foreign-record-type))))
 
-(defun linux64::expand-ff-call (callform args)
+(defun linux64::expand-ff-call (callform args &key (arg-coerce #'null-coerce-foreign-arg) (result-coerce #'null-coerce-foreign-result))
   (let* ((result-type-spec (or (car (last args)) :void)))
     (multiple-value-bind (result-type error)
@@ -75,5 +75,5 @@
                   (progn
                     (argforms (foreign-type-to-representation-type ftype))
-                    (argforms arg-value-form)))))))
+                    (argforms (funcall arg-coerce arg-type-spec arg-value-form))))))))
         (argforms (foreign-type-to-representation-type result-type))
-        `(,@callform ,@(argforms))))))
+        (funcall result-coerce result-type-spec `(,@callform ,@(argforms)))))))
