Changeset 14462


Ignore:
Timestamp:
Dec 1, 2010, 10:01:09 PM (9 years ago)
Author:
gb
Message:

Fix protocol handling for Cocotron.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/objc-bridge/objc-support.lisp

    r14377 r14462  
    4848        (incf n)))))
    4949
     50
    5051(defun %note-protocol (p)
    51   (with-macptrs ((cname (objc-message-send p "name" :address)))
     52  ;; In Cocotron (which is ultimately based on the GNU ObjC runtime),
     53  ;; it may be the case that some Protocol objects aren't fully initialized
     54  ;; when this code runs, hence the sleazy use of PREF here.
     55  (with-macptrs ((cname #+cocotron-objc (pref p #>Protocol.nameCString)
     56                        #-cocotron-objc (objc-message-send p "name" :address)))
    5257    (let* ((namelen (%cstrlen cname))
    5358           (name (make-string namelen)))
     
    6469
    6570(defun note-class-protocols (class)
    66   #-(or apple-objc-2.0 cocotron-objc)
     71  #-(or apple-objc-2.0)
    6772  (do* ((protocols (pref class :objc_class.protocols)
    6873                   (pref protocols :objc_protocol_list.next)))
     
    7378          (with-macptrs ((p (paref list (:* (:* (:struct :<P>rotocol))) i)))
    7479            (%note-protocol p))))))
    75   #+(or apple-objc-2.0 cocotron-objc)
     80  #+(or apple-objc-2.0)
    7681  (rlet ((p-out-count :int 0))
    7782    (with-macptrs ((protocols (#_class_copyProtocolList class p-out-count)))
Note: See TracChangeset for help on using the changeset viewer.