Permalink
Browse files

[bootstrap] Fixed 'error: template with C linkage' error.

  • Loading branch information...
1 parent c4acf0b commit 118446032acae757f2c4580914759e3ab0a4f787 @westbaer committed Oct 6, 2011
Showing with 8 additions and 6 deletions.
  1. +8 −6 bin/bootstrap.sh
View
@@ -115,12 +115,6 @@ MSImageRef MSGetImageByName(const char *file);
#define MSInitialize \
__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 __arm__
@@ -130,6 +124,14 @@ void MSHookMessageEx(Class _class, SEL sel, IMP imp, IMP *result);
#endif
#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
__EOF
}

0 comments on commit 1184460

Please sign in to comment.