From 161800b451fbc2cb9ad5952cd3d7ff8d002e800e Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Thu, 6 Mar 2008 12:08:14 +0100 Subject: Convert :ID, :CLASS, and :SELECTOR values returned by callbacks into pointers. darcs-hash:6a6f4e1acfe44e0ea057531a8254c0283b024522 --- Lisp/method-definition.lisp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Lisp/method-definition.lisp b/Lisp/method-definition.lisp index a6b9ea2..edba760 100644 --- a/Lisp/method-definition.lisp +++ b/Lisp/method-definition.lisp @@ -312,7 +312,7 @@ __define-objective-c-generic-function__. (eval (loop for type in argument-types for symbol in arg-symbols collect (list symbol (typespec->c-type type)) into cffi-lambda-list - if (member type '(:id :class :selector)) + if (member (typespec-primary-type type) '(:id :class :selector)) collect `(intern-pointer-wrapper ',type :pointer ,symbol) into arguments else @@ -327,10 +327,13 @@ __define-objective-c-generic-function__. ,@arguments)) (format t "~&~A" (list ,@arg-symbols))) (unwind-protect - (,(generic-function-name gf) - ;; Leave the second argument (the - ;; selector) out. - ,@(list* (car arguments) (cddr arguments))) + (,(case (typespec-primary-type return-type) + ((:id :class :selector) 'pointer) + (t 'progn)) + (,(generic-function-name gf) + ;; Leave the second argument (the + ;; selector) out. + ,@(list* (car arguments) (cddr arguments)))) ;; FIXME: We may want to wrap signalled ;; SERIOUS-CONDITIONS in some kind of ;; Objective-C exception object and put -- cgit v1.2.3