From 9f42bd09be63cf0b3b92eea7075cf95d2b96eb49 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Fri, 7 Mar 2008 00:17:11 +0100 Subject: Have callbacks properly return pointers to :ID, :CLASS and :SELECTOR values. darcs-hash:d22c6d2a2f51f9653328a76b1de9059f3a9ff61b --- Lisp/method-definition.lisp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Lisp/method-definition.lisp b/Lisp/method-definition.lisp index 38bc702..f057244 100644 --- a/Lisp/method-definition.lisp +++ b/Lisp/method-definition.lisp @@ -424,17 +424,21 @@ __define-objective-c-generic-function__. ,@arguments)) (format t "~&~A" (list ,@arg-symbols))) (unwind-protect - (coerce-object - (,(generic-function-name gf) - ;; Pass the class this method is - ;; being defined for as the first - ;; argument. This is needed so that - ;; super calls can work. - ',(class-name class) - ;; Leave the second argument (the - ;; selector) out. - ,@(list* (car arguments) (cddr arguments))) - ',return-type) + (,(if (member (typespec-primary-type return-type) + '(:id :class :selector)) + 'pointer + 'progn) + (coerce-object + (,(generic-function-name gf) + ;; Pass the class this method is + ;; being defined for as the first + ;; argument. This is needed so that + ;; super calls can work. + ',(class-name class) + ;; Leave the second argument (the + ;; selector) out. + ,@(list* (car arguments) (cddr arguments))) + ',return-type)) ;; FIXME: We may want to wrap signalled ;; SERIOUS-CONDITIONS in some kind of ;; Objective-C exception object and put -- cgit v1.2.3