]> git.saurik.com Git - cycript.git/commitdiff
Fix build of cycript when using g++-fsf from Fink.
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 10 Nov 2015 08:58:35 +0000 (00:58 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 10 Nov 2015 08:58:35 +0000 (00:58 -0800)
Inject.cpp
Makefile.am
Makefile.in
ObjectiveC/Library.mm

index 051fc0c2764fa07eb42d6a927baf05c12db45087..eb8535190c0fa3d88e636476851b56450a477271 100644 (file)
@@ -28,6 +28,8 @@
 #include "Pooling.hpp"
 
 #if defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__))
 #include "Pooling.hpp"
 
 #if defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__))
+#include <unistd.h>
+
 #include <sys/fcntl.h>
 #include <sys/mman.h>
 
 #include <sys/fcntl.h>
 #include <sys/mman.h>
 
@@ -65,7 +67,8 @@ void InjectLibrary(int pid, int argc, const char *argv[]) {
     off_t offset;
     _assert(csops(pid, CS_OPS_PIDOFFSET, &offset, sizeof(offset)) != -1);
 
     off_t offset;
     _assert(csops(pid, CS_OPS_PIDOFFSET, &offset, sizeof(offset)) != -1);
 
-    char path[PATH_MAX];
+    // XXX: implement a safe version of this
+    char path[4096];
     int writ(proc_pidpath(pid, path, sizeof(path)));
     _assert(writ != 0);
 
     int writ(proc_pidpath(pid, path, sizeof(path)));
     _assert(writ != 0);
 
index b9e7b643c36db9ea185f2f89311e5cfb22659b0a..57cdbdc5d7fc72549d05cb8bcd8fffcc90079e09 100644 (file)
@@ -28,6 +28,8 @@ ACLOCAL_AMFLAGS = -I m4
 AM_CPPFLAGS = -DYYDEBUG=1
 AM_CPPFLAGS += -include config.h -include $(srcdir)/unconfig.h
 
 AM_CPPFLAGS = -DYYDEBUG=1
 AM_CPPFLAGS += -include config.h -include $(srcdir)/unconfig.h
 
+AM_OBJCXXFLAGS = -fobjc-exceptions
+
 CY_LDFLAGS = -no-undefined -avoid-version -export-dynamic
 
 lib_LTLIBRARIES = 
 CY_LDFLAGS = -no-undefined -avoid-version -export-dynamic
 
 lib_LTLIBRARIES = 
index 429f0432193df14f1ee7c278291eaa336b30ea7c..f94d4273d07a0eecefa2ed1e5e51261c5b37c425 100644 (file)
@@ -538,6 +538,7 @@ SUBDIRS =
 ACLOCAL_AMFLAGS = -I m4
 AM_CPPFLAGS = -DYYDEBUG=1 -include config.h -include \
        $(srcdir)/unconfig.h $(am__append_3) $(am__append_14)
 ACLOCAL_AMFLAGS = -I m4
 AM_CPPFLAGS = -DYYDEBUG=1 -include config.h -include \
        $(srcdir)/unconfig.h $(am__append_3) $(am__append_14)
+AM_OBJCXXFLAGS = -fobjc-exceptions
 CY_LDFLAGS = -no-undefined -avoid-version -export-dynamic
 lib_LTLIBRARIES = libcycript.la
 libcycript_la_LDFLAGS = $(CY_LDFLAGS)
 CY_LDFLAGS = -no-undefined -avoid-version -export-dynamic
 lib_LTLIBRARIES = libcycript.la
 libcycript_la_LDFLAGS = $(CY_LDFLAGS)
index ee1f5bf0072b44e8a0ff4f055551e48ff8ab4ca3..e68fb1ba43122a7728a9d8efdf3ee4327cef219a 100644 (file)
@@ -159,7 +159,7 @@ const char *CYPoolCString(CYPool &pool, JSContextRef context, NSString *value) {
     return string;
 }
 
     return string;
 }
 
-#ifdef __APPLE__
+#ifdef __clang__
 JSStringRef CYCopyJSString(JSContextRef context, NSString *value) {
     return JSStringCreateWithCFString(reinterpret_cast<CFStringRef>(value));
 }
 JSStringRef CYCopyJSString(JSContextRef context, NSString *value) {
     return JSStringCreateWithCFString(reinterpret_cast<CFStringRef>(value));
 }
@@ -170,7 +170,7 @@ JSStringRef CYCopyJSString(JSContextRef context, NSObject *value) {
         return NULL;
     // XXX: this definition scares me; is anyone using this?!
     NSString *string([value description]);
         return NULL;
     // XXX: this definition scares me; is anyone using this?!
     NSString *string([value description]);
-#ifdef __APPLE__
+#ifdef __clang__
     return CYCopyJSString(context, string);
 #else
     CYPool pool;
     return CYCopyJSString(context, string);
 #else
     CYPool pool;
@@ -767,7 +767,7 @@ NSObject *CYCopyNSObject(CYPool &pool, JSContextRef context, JSValueRef value) {
     [json appendString:@"@["];
 
     bool comma(false);
     [json appendString:@"@["];
 
     bool comma(false);
-#ifdef __APPLE__
+#ifdef __clang__
     for (id object in self) {
 #else
     for (size_t index(0), count([self count]); index != count; ++index) {
     for (id object in self) {
 #else
     for (size_t index(0), count([self count]); index != count; ++index) {
@@ -877,7 +877,7 @@ NSObject *CYCopyNSObject(CYPool &pool, JSContextRef context, JSValueRef value) {
     [json appendString:@"@{"];
 
     bool comma(false);
     [json appendString:@"@{"];
 
     bool comma(false);
-#ifdef __APPLE__
+#ifdef __clang__
     for (NSObject *key in self) {
 #else
     NSEnumerator *keys([self keyEnumerator]);
     for (NSObject *key in self) {
 #else
     NSEnumerator *keys([self keyEnumerator]);
@@ -908,7 +908,7 @@ NSObject *CYCopyNSObject(CYPool &pool, JSContextRef context, JSValueRef value) {
 - (void) cy$getPropertyNames:(JSPropertyNameAccumulatorRef)names inContext:(JSContextRef)context {
     [super cy$getPropertyNames:names inContext:context];
 
 - (void) cy$getPropertyNames:(JSPropertyNameAccumulatorRef)names inContext:(JSContextRef)context {
     [super cy$getPropertyNames:names inContext:context];
 
-#ifdef __APPLE__
+#ifdef __clang__
     for (NSObject *key in self) {
 #else
     NSEnumerator *keys([self keyEnumerator]);
     for (NSObject *key in self) {
 #else
     NSEnumerator *keys([self keyEnumerator]);
@@ -2255,7 +2255,7 @@ static JSValueRef choose(JSContextRef context, JSObjectRef object, JSObjectRef _
     CYGarbageCollect(context);
 
     CYPool pool;
     CYGarbageCollect(context);
 
     CYPool pool;
-    Class _class(CYCastNSObject(&pool, context, arguments[0]));
+    id _class(CYCastNSObject(&pool, context, arguments[0]));
 
     vm_address_t *zones(NULL);
     unsigned size(0);
 
     vm_address_t *zones(NULL);
     unsigned size(0);