File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,25 @@ mod tests {
206
206
use objc:: runtime:: Object ;
207
207
use objc:: { class, msg_send} ;
208
208
209
+ #[ cfg( not( target_vendor = "apple" ) ) ]
210
+ use objc:: runtime:: Class ;
211
+
212
+ #[ cfg( not( target_vendor = "apple" ) ) ]
213
+ #[ link( name = "gnustep-base" , kind = "dylib" ) ]
214
+ extern "C" { }
215
+
216
+ // TODO: Remove the need for this hack
217
+ #[ cfg( not( target_vendor = "apple" ) ) ]
218
+ extern "C" {
219
+ static _OBJC_CLASS_NSObject: Class ;
220
+ }
221
+
222
+ #[ cfg( not( target_vendor = "apple" ) ) ]
223
+ #[ test]
224
+ fn get_class_to_force_linkage ( ) {
225
+ unsafe { & _OBJC_CLASS_NSObject } ;
226
+ }
227
+
209
228
fn retain_count ( obj : & Object ) -> usize {
210
229
unsafe { msg_send ! [ obj, retainCount] }
211
230
}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ which can be cloned to allow multiple references.
11
11
12
12
Weak references may be created using the [`WeakId`](struct.WeakId.html) struct.
13
13
14
- ```
14
+ ```no_run
15
15
# use objc::msg_send;
16
16
use objc::runtime::{Class, Object};
17
17
use objc_id::{Id, WeakId};
You can’t perform that action at this time.
0 commit comments