diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-03-06 12:08:14 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-03-06 12:08:14 +0100 |
commit | 161800b451fbc2cb9ad5952cd3d7ff8d002e800e (patch) | |
tree | 7eea3798b58098dac97bcc759a14f5957535009f | |
parent | a3028e348861cbe01ede6501df884646a0df262e (diff) |
Convert :ID, :CLASS, and :SELECTOR values returned by callbacks into pointers.
darcs-hash:6a6f4e1acfe44e0ea057531a8254c0283b024522
-rw-r--r-- | Lisp/method-definition.lisp | 13 |
1 files 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 |