Changeset 565


Ignore:
Timestamp:
Feb 23, 2004, 5:40:39 PM (21 years ago)
Author:
Gary Byers
Message:

method lookup: ensure class is initialized, via fairly obscure means.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/objc-runtime.lisp

    r544 r565  
    15131513
    15141514(defun class-get-instance-method (class sel)
    1515   #+apple-objc (#_class_getInstanceMethod class sel)
     1515  #+apple-objc (progn
     1516                 (unless (logtest #$CLS_INITIALIZED (pref (pref class :objc_class.isa)  :objc_class.info))
     1517                   ;; Do this for effect; ignore the :<IMP> it returns.
     1518                   ;; (It should cause the CLS_NEED_BIND flag to turn itself
     1519                   ;; off after the class has been initialized; we need
     1520                   ;; the class and all superclasses to have been initialized,
     1521                   ;; so that we can find category methods via
     1522                   ;; #_class_getInstanceMethod.
     1523                   (external-call "__class_lookupMethodAndLoadCache"
     1524                                  :id class
     1525                                  :<SEL> sel
     1526                                  :address))
     1527                 (#_class_getInstanceMethod class sel))
    15161528  #+gnu-objc (#_class_get_instance_method class sel))
    15171529
Note: See TracChangeset for help on using the changeset viewer.