ffi/unsafe/obj: ignore NULL protocols
If the `#:protocols` clauses of a `define-objc-class` form includes
errors, but it simplifies the declaration of protocols that are
introduced in different versions of a framework, and it's effectively
more compatible with the implementation before dc0898f5ef
.
This commit is contained in:
parent
d2ef35082a
commit
7bccfa7824
|
@ -160,7 +160,8 @@ FFI type @racket[_Class]). The @racket[superclass-expr] should produce
|
|||
an Objective-C class or @racket[#f] for the superclass. An optional
|
||||
@racket[#:mixins] clause can specify mixins defined with
|
||||
@racket[define-objc-mixin]. An optional @racket[#:protocols] clause
|
||||
can specify Objective-C protocols to be implemented by the class.
|
||||
can specify Objective-C protocols to be implemented by the class, where
|
||||
a @racket[#f] result for a @racket[protocol-expr] is ignored.
|
||||
|
||||
Each @racket[field-id] is an instance field that holds a Racket value
|
||||
and that is initialized to @racket[#f] when the object is
|
||||
|
@ -203,7 +204,10 @@ space for each @racket[field-id] within the instance is deallocated.
|
|||
(- _void (dealloc)
|
||||
(when bm (done-with-bm bm))))
|
||||
(void))
|
||||
]}
|
||||
]
|
||||
|
||||
@history[#:changed "6.90.0.26" @elem{Changed @racket[#:protocols] handling to
|
||||
ignore @racket[#f] expression results.}]}
|
||||
|
||||
@defform[(define-objc-mixin (class-id superclass-id)
|
||||
maybe-mixins
|
||||
|
|
|
@ -729,11 +729,10 @@
|
|||
(objc_addClass (cast id _Class _objc_class-pointer))))
|
||||
|
||||
(define (add-protocol id proto)
|
||||
(unless proto
|
||||
(error 'add-protocol "NULL protocol"))
|
||||
(if class_addProtocol
|
||||
(class_addProtocol id proto)
|
||||
(add-protocol-the-hard-way id proto)))
|
||||
(when proto
|
||||
(if class_addProtocol
|
||||
(class_addProtocol id proto)
|
||||
(add-protocol-the-hard-way id proto))))
|
||||
|
||||
(define (object-get-class id)
|
||||
(if object_getClass
|
||||
|
|
Loading…
Reference in New Issue
Block a user