From 9567837688897dd742899612a9701fc590f54326 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 31 Oct 2009 20:12:47 +0000 Subject: [PATCH] Fixed a few bugs in the cross-compile and a GNUstep related casting issue. --- Console.cpp | 1 + Darwin.mk | 2 +- ObjectiveC/Library.mm | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Console.cpp b/Console.cpp index 49952e4..77e9759 100644 --- a/Console.cpp +++ b/Console.cpp @@ -542,6 +542,7 @@ int Main(int argc, char const * const argv[], char const * const envp[]) { } } catch (...) { _syscall(close(server)); + throw; } } #else diff --git a/Darwin.mk b/Darwin.mk index a1773fd..9c480e2 100644 --- a/Darwin.mk +++ b/Darwin.mk @@ -15,6 +15,6 @@ inject += Mach/Inject.o Mach/Inject.o: Trampoline.t.hpp Baton.hpp %.t.hpp: %.t.cpp - $(target)gcc -c -o $*.t.o $< && { $(target)otool -l $*.t.o | sed -e '/^ *segname __TEXT$$/ { x; s/^ *sectname //; p; }; /^ *sectname / x; d;' | while read -r sect; do otool -s __TEXT "$$sect" Trampoline.t.o; done | sed -e '/:$$/ d; / section$$/ d; s/^[^ \t]*[ \t]*//;s/ $$//;s/ /\n/g' | sed -e 's/\(..\)\(..\)\(..\)\(..\)/0\x\4,0\x\3,0\x\2,0\x\1/' | tr '\n' ',' | sed -e '$$ s/,$$//; s/^/static const char $*_[] = {/;s/$$/};\n/' && echo && echo "/*" && $(target)otool -vVt $*.t.o && echo "*/"; } >$@ && rm -f $*.t.o + $(target)gcc -c -o $*.t.o $< && { $(target)otool -l $*.t.o | sed -e '/^ *segname __TEXT$$/ { x; s/^ *sectname //; p; }; /^ *sectname / x; d;' | while read -r sect; do $(target)otool -s __TEXT "$$sect" Trampoline.t.o; done | sed -e '/:$$/ d; / section$$/ d; s/^[^ \t]*[ \t]*//;s/ $$//;s/ /\n/g' | sed -e 's/\(..\)\(..\)\(..\)\(..\)/0\x\4,0\x\3,0\x\2,0\x\1/' | tr '\n' ',' | sed -e '$$ s/,$$//; s/^/static const char $*_[] = {/;s/$$/};\n/' && echo && echo "/*" && $(target)otool -vVt $*.t.o && echo "*/"; } >$@ && rm -f $*.t.o include ObjectiveC.mk diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 128d1f2..83e4776 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -2135,7 +2135,8 @@ static JSValueRef Selector_callAsFunction_toCYON(JSContextRef context, JSObjectR const char *name(sel_getName(internal->GetValue())); CYPoolTry { - return CYCastJSValue(context, CYJSString(context, [NSString stringWithFormat:@"@selector(%s)", name])); + NSString *string([NSString stringWithFormat:@"@selector(%s)", name]); + return CYCastJSValue(context, CYJSString(context, string)); } CYPoolCatch(NULL) } CYCatch } -- 2.45.2