summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-03-06 12:08:14 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-03-06 12:08:14 +0100
commit161800b451fbc2cb9ad5952cd3d7ff8d002e800e (patch)
tree7eea3798b58098dac97bcc759a14f5957535009f
parenta3028e348861cbe01ede6501df884646a0df262e (diff)
Convert :ID, :CLASS, and :SELECTOR values returned by callbacks into pointers.
darcs-hash:6a6f4e1acfe44e0ea057531a8254c0283b024522
-rw-r--r--Lisp/method-definition.lisp13
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