From: Jay Freeman (saurik) Date: Fri, 23 Oct 2009 05:20:08 +0000 (+0000) Subject: Various typo-fixes in the attempt to port to GNUstep. X-Git-Tag: v0.9.432~267 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/7677a0456c1d3b85c862ca4f5fd6d9da2aa9782d Various typo-fixes in the attempt to port to GNUstep. --- diff --git a/Library.mm b/Library.mm index bb76f49..263c73c 100644 --- a/Library.mm +++ b/Library.mm @@ -38,6 +38,8 @@ /* }}} */ #include +#include + #include "cycript.hpp" #include "sig/parse.hpp" @@ -98,6 +100,11 @@ } \ } +#ifndef __APPLE__ +#define class_getSuperclass GSObjCSuper +#define object_getClass GSObjCClass +#endif + void CYThrow(JSContextRef context, JSValueRef value); const char *CYPoolCCYON(apr_pool_t *pool, JSContextRef context, JSValueRef value, JSValueRef *exception); @@ -440,7 +447,7 @@ struct Instance : static JSObjectRef Make(JSContextRef context, id object, Flags flags = None) { JSObjectRef value(JSObjectMake(context, Instance_, new Instance(object, flags))); - JSObjectSetPrototype(context, value, CYGetClassPrototype(context, object == nil ? nil : object_getClass(object))); + JSObjectSetPrototype(context, value, CYGetClassPrototype(context, object_getClass(object))); return value; } @@ -1496,7 +1503,7 @@ id CYNSObject(apr_pool_t *pool, JSContextRef context, JSValueRef value, bool cas object = (id) (CYCastBool(context, value) ? kCFBooleanTrue : kCFBooleanFalse); copy = false; #else - object = [[NSNumber alloc] initWithBoolean:value]; + object = [[NSNumber alloc] initWithBool:CYCastBool(context, value)]; copy = true; #endif break; diff --git a/makefile b/makefile index 84a03f8..0a6ab18 100644 --- a/makefile +++ b/makefile @@ -114,7 +114,7 @@ lex.cy.o: lex.cy.c Cycript.tab.hh Parser.hpp Pooling.hpp $(target)g++ $(flags) -c -o $@ $< %.o: %.mm $(header) - $(target)g++ $(flags) -c -o $@ $< $(objc) + $(target)g++ $(objc) $(flags) -c -o $@ $< libcycript.$(dll): $(code) $(target)g++ $(flags) -shared -dynamiclib -o $@ $(filter %.o,$^) $(library) $(link)