Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9851052

Browse files
author
rozbo
committed
fix stitute
1 parent 4550f01 commit 9851052

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

-32 Bytes
Binary file not shown.

FrameworksForMac/substrate.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ static inline void MSHookMessage(Class _class, SEL sel, Type_ *imp, Type_ **resu
136136
template <typename Type_>
137137
static inline Type_ &MSHookIvar(id self, const char *name) {
138138
Ivar ivar(class_getInstanceVariable(object_getClass(self), name));
139-
void *pointer(ivar == NULL ? NULL : reinterpret_cast<char *>(self) + ivar_getOffset(ivar));
139+
#if __has_feature(objc_arc)
140+
void *pointer(ivar == NULL ? NULL : reinterpret_cast<char *>((__bridge void *)self) + ivar_getOffset(ivar));
141+
#else
142+
void *pointer(ivar == NULL ? NULL : reinterpret_cast<char *>(self) + ivar_getOffset(ivar));
143+
#endif
140144
return *reinterpret_cast<Type_ *>(pointer);
141145
}
142146

0 commit comments

Comments
 (0)