]> git.saurik.com Git - cycript.git/blobdiff - Trampoline.t.cpp
Fix (again) process injection on desktop Mac OS X.
[cycript.git] / Trampoline.t.cpp
index 297486e6df91592d9ff5390aa46beb31a7685c22..1bcbb18c9afcf1de9181d05b5f52528111b99b0f 100644 (file)
 /* }}} */
 
 #include <TargetConditionals.h>
+#if defined(__arm__) || defined(__arm64__)
 #undef TARGET_IPHONE_SIMULATOR
 #define TARGET_IPHONE_SIMULATOR 1
+#endif
 #define _PTHREAD_ATTR_T
 #include <pthread_internals.h>
+#if defined(__arm__) || defined(__arm64__)
 #undef TARGET_IPHONE_SIMULATOR
-#define TARGET_IPHONE_SIMULATOR 0
+#endif
 
 #include <mach-o/dyld.h>
 #include <mach-o/dyld_images.h>
@@ -250,6 +253,8 @@ extern "C" void Start(Baton *baton) {
     tsd = reinterpret_cast<void **>(tpid & ~3);
     if (tsd != NULL)
         tsd[0] = &self;
+#else
+    _pthread_setspecific_direct(0, &self);
 #endif
 
     int (*$pthread_join)(pthread_t, void **);