diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2007-09-18 17:00:21 +0200 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2007-09-18 17:00:21 +0200 |
commit | 50025d579200f44fa24701bfbb4199f652c1fe52 (patch) | |
tree | 0b74ee690eb4f8eb663d938daa11c96fc64f44ca /Lisp/method-invocation.lisp | |
parent | 01fd2213c11ae1455ef305803cdc5ae674e2e75b (diff) |
Simplify the Objective-C layer, make the newest additions compatible with the Apple runtime.
darcs-hash:c6ec225e9ccf78e267f1a4985971ec9ac3239bc8
Diffstat (limited to 'Lisp/method-invocation.lisp')
-rw-r--r-- | Lisp/method-invocation.lisp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Lisp/method-invocation.lisp b/Lisp/method-invocation.lisp index edbdc17..6176553 100644 --- a/Lisp/method-invocation.lisp +++ b/Lisp/method-invocation.lisp @@ -4,7 +4,7 @@ (eval-when (:compile-toplevel :load-toplevel :execute) (unless (boundp '+nil+) (defconstant +nil+ - (make-instance 'id :pointer (objcl-get-nil))))) + (make-instance 'id :pointer (objcl-get-nil))))) ;;; (@* "Method invocation") @@ -154,7 +154,8 @@ Returns: *result* --- the return value of the method invocation. (defmacro unsafe-primitive-invoke (receiver method-name return-type &rest args) - (let ((real-return-type (if (member return-type '(id objc-class exception)) + (let ((real-return-type (if (member return-type '(id objc-class exception + selector)) :pointer return-type)) (real-receiver (gensym)) @@ -175,13 +176,10 @@ Returns: *result* --- the return value of the method invocation. (list :pointer (pointer-to ,real-selector)) objc-arglist (list ,real-return-type))))) - ,(if (member return-type '(id objc-class exception)) + ,(if (member return-type '(id objc-class exception selector)) `(let (,@(when (constructor-name-p (selector-name selector)) `((*skip-retaining* t)))) - (make-instance ',(case return-type - ((id) 'id) - ((objc-class) 'objc-class) - ((exception) 'exception)) + (make-instance return-type :pointer return-value)) `return-value)) (dealloc-objc-arglist objc-arglist))))))) @@ -277,8 +275,7 @@ Returns: *result* --- the return value of the method invocation. return-c-type))) (if (cffi:null-pointer-p pointer) nil - (make-instance return-type - :pointer pointer)))) + (make-instance return-type :pointer pointer)))) ((:void) (values)) (otherwise (cffi:mem-ref return-value-cell return-c-type))))))))))) |