Skip to content

Commit

Permalink
[bootstrap] Fixed 'error: template with C linkage' error.
Browse files Browse the repository at this point in the history
  • Loading branch information
westbaer committed Oct 6, 2011
1 parent c4acf0b commit 1184460
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bin/bootstrap.sh
Expand Up @@ -115,12 +115,6 @@ MSImageRef MSGetImageByName(const char *file);
#define MSInitialize \ #define MSInitialize \
__attribute__((constructor)) static void _MSInitialize(void) __attribute__((constructor)) static void _MSInitialize(void)
template <typename Type_>
static inline Type_ &MSHookIvar(id self, const char *name) {
Ivar ivar(class_getInstanceVariable(object_getClass(self), name));
void *pointer(ivar == NULL ? NULL : reinterpret_cast<char *>(self) + ivar_getOffset(ivar));
return *reinterpret_cast<Type_ *>(pointer);
}
#ifdef __APPLE__ #ifdef __APPLE__
#ifdef __arm__ #ifdef __arm__
Expand All @@ -130,6 +124,14 @@ void MSHookMessageEx(Class _class, SEL sel, IMP imp, IMP *result);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
template <typename Type_>
static inline Type_ &MSHookIvar(id self, const char *name) {
Ivar ivar(class_getInstanceVariable(object_getClass(self), name));
void *pointer(ivar == NULL ? NULL : reinterpret_cast<char *>(self) + ivar_getOffset(ivar));
return *reinterpret_cast<Type_ *>(pointer);
}
#endif #endif
__EOF __EOF
} }
Expand Down

0 comments on commit 1184460

Please sign in to comment.