File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -178,11 +178,17 @@ pub mod __gnustep_hack {
178178 #[ link( name = "gnustep-base" , kind = "dylib" ) ]
179179 // This linking doesn't have to be on the correct `extern` block.
180180 extern "C" {
181- static _OBJC_CLASS_NSObject: Class ;
181+ // The linking changed in libobjc2 v2.0
182+ #[ cfg_attr( feature = "gnustep-2-0" , link_name = "._OBJC_CLASS_NSObject" ) ]
183+ #[ cfg_attr( not( feature = "gnustep-2-0" ) , link_name = "_OBJC_CLASS_NSObject" ) ]
184+ static OBJC_CLASS_NSObject : Class ;
185+ // Others:
186+ // __objc_class_name_NSObject
187+ // _OBJC_CLASS_REF_NSObject
182188 }
183189
184190 pub unsafe fn get_class_to_force_linkage ( ) -> & ' static Class {
185- unsafe { core:: ptr:: read_volatile ( & & _OBJC_CLASS_NSObject ) }
191+ unsafe { core:: ptr:: read_volatile ( & & OBJC_CLASS_NSObject ) }
186192 }
187193
188194 #[ test]
You can’t perform that action at this time.
0 commit comments