@@ -57,8 +57,13 @@ mono_dead_letter_dealloc (id self, SEL _cmd)
57
57
{
58
58
struct objc_super super ;
59
59
super .receiver = self ;
60
+ #if !defined(__cplusplus ) && !__OBJC2__
60
61
super .class = nsobject ;
61
- objc_msgSendSuper (& super , dealloc );
62
+ #else
63
+ super .super_class = nsobject ;
64
+ #endif
65
+ void (* objc_msgSendSuper_op )(struct objc_super * , SEL ) = (void (* )(struct objc_super * , SEL )) objc_msgSendSuper ;
66
+ objc_msgSendSuper_op (& super , dealloc );
62
67
63
68
mono_thread_info_detach ();
64
69
}
@@ -75,19 +80,20 @@ mono_threads_install_dead_letter (void)
75
80
* It doesn't hurt on other architectures either, so no need to #ifdef it only for ARM64.
76
81
*/
77
82
83
+ id (* id_objc_msgSend )(id , SEL ) = (id (* )(id , SEL )) objc_msgSend ;
78
84
id (* id_objc_msgSend_id )(id , SEL , id ) = (id (* )(id , SEL , id )) objc_msgSend ;
79
85
void (* objc_msgSend_id_id )(id , SEL , id , id ) = (void (* )(id , SEL , id , id )) objc_msgSend ;
80
86
81
- cur = objc_msgSend ((id )nsthread , currentThread );
87
+ cur = id_objc_msgSend ((id )nsthread , currentThread );
82
88
if (!cur )
83
89
return ;
84
- dict = objc_msgSend (cur , threadDictionary );
90
+ dict = id_objc_msgSend (cur , threadDictionary );
85
91
if (dict && id_objc_msgSend_id (dict , objectForKey , mono_dead_letter_key ) == nil ) {
86
- id value = objc_msgSend ( objc_msgSend ((id )mono_dead_letter_class , alloc ), init );
92
+ id value = id_objc_msgSend ( id_objc_msgSend ((id )mono_dead_letter_class , alloc ), init );
87
93
88
94
objc_msgSend_id_id (dict , setObjectForKey , value , mono_dead_letter_key );
89
95
90
- objc_msgSend (value , release );
96
+ id_objc_msgSend (value , release );
91
97
}
92
98
}
93
99
@@ -119,13 +125,15 @@ mono_threads_init_dead_letter (void)
119
125
class_addMethod (mono_dead_letter_class , dealloc , (IMP )mono_dead_letter_dealloc , "v@:" );
120
126
objc_registerClassPair (mono_dead_letter_class );
121
127
128
+ id (* id_objc_msgSend )(id , SEL ) = (id (* )(id , SEL )) objc_msgSend ;
129
+
122
130
// create the dict key
123
- pool = objc_msgSend ( objc_msgSend (nsautoreleasepool , alloc ), init );
131
+ pool = id_objc_msgSend ( id_objc_msgSend (nsautoreleasepool , alloc ), init );
124
132
125
133
id (* objc_msgSend_char )(id , SEL , const char * ) = (id (* )(id , SEL , const char * )) objc_msgSend ;
126
134
mono_dead_letter_key = objc_msgSend_char (nsstring , stringWithUTF8String , "mono-dead-letter" );
127
135
128
- objc_msgSend (mono_dead_letter_key , retain );
129
- objc_msgSend (pool , release );
136
+ id_objc_msgSend (mono_dead_letter_key , retain );
137
+ id_objc_msgSend (pool , release );
130
138
}
131
139
#endif
0 commit comments