@@ -21,12 +21,14 @@ #ifndef __has_feature # define __has_feature(x) 0 #endif #if __has_feature(objc_arc) +# define OBJC_UNSAFE_UNRETAINED __unsafe_unretained # define OBJC_BRIDGE __bridge #else +# define OBJC_UNSAFE_UNRETAINED # define OBJC_BRIDGE #endif typedef struct objc_class *Class; typedef struct objc_object *id; @@ -71,11 +73,11 @@ uintptr_t uid; const char *types; }; struct objc_super { - id self; + OBJC_UNSAFE_UNRETAINED id self; Class cls; }; struct objc_method { struct objc_selector sel; @@ -152,11 +154,11 @@ #endif struct objc_protocol_list { struct objc_protocol_list *next; long count; - Protocol *list[1]; + OBJC_UNSAFE_UNRETAINED Protocol *list[1]; }; #define Nil (Class)0 #define nil (id)0 #define YES (BOOL)1 @@ -220,13 +222,14 @@ } static inline BOOL class_isMetaClass(Class cls_) { - struct objc_class *cls = (struct objc_class*)cls_; + struct objc_class *cls = (OBJC_BRIDGE struct objc_class*)cls_; return (cls->info & OBJC_CLASS_INFO_METACLASS); } +#undef OBJC_UNSAFE_UNRETAINED #undef OBJC_BRIDGE #endif