diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-03 09:47:06 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-03 09:47:06 +0100 |
commit | ac2957521b8d870352be375f59c4b72605f226eb (patch) | |
tree | 60d78ae7dc3765edb000954e163064b52c304416 | |
parent | e93416cc05a38b34956e88b9516af5b910d5df19 (diff) |
Make (DEFCLASS SELECTOR ...) work on Allegro CL.
darcs-hash:1a27f84277b0ed60eefb45499ebac15506aebd20
-rw-r--r-- | Lisp/data-types.lisp | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/Lisp/data-types.lisp b/Lisp/data-types.lisp index ba98fc3..788db5b 100644 --- a/Lisp/data-types.lisp +++ b/Lisp/data-types.lisp @@ -31,14 +31,34 @@ ;;;; (@* "Objective-C object wrapper classes") -(defclass c-pointer-wrapper () - ((pointer :type c-pointer - :reader pointer-to - :initarg :pointer - :initform (cffi:null-pointer)))) - - -(defclass selector (c2mop:funcallable-standard-object c-pointer-wrapper) () +(with-compilation-unit () ; needed for class finalization + (defclass c-pointer-wrapper () + ((pointer :type c-pointer + :reader pointer-to + :initarg :pointer + :initform (cffi:null-pointer))))) + + +;; The following may be needed by some implementations (namely Allegro +;; CL), but I'm not sure. +(eval-when (:compile-toplevel :load-toplevel :execute) + (loop for class-name in '(c2mop:funcallable-standard-object + c-pointer-wrapper) + for class = (find-class class-name nil) + when class + unless (c2mop:class-finalized-p class) + do (c2mop:finalize-inheritance class))) + + +;; FIXME: I'm not confident about this, but it is needed in order to +;; make (DEFCLASS SELECTOR ...) work. +(defmethod c2mop:validate-superclass ((class c2mop:funcallable-standard-class) + (superclass standard-class)) + t) + + +(defclass selector (c2mop:funcallable-standard-object c-pointer-wrapper) + () (:metaclass c2mop:funcallable-standard-class) (:documentation "An Objective-C method selector. |