Skip to content

Commit

Permalink
Merge pull request #6524 from vishalduggal/ti_headers_update-35X
Browse files Browse the repository at this point in the history
Titanium Update (3_5_X)
  • Loading branch information
pec1985 committed Dec 22, 2014
2 parents 9c1416c + 9f4f66e commit ce0fbbb
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 15 deletions.
66 changes: 51 additions & 15 deletions iphone/Classes/KrollMethod.m
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,6 @@ -(id)call:(NSArray*)args

[invocation invoke];

if ([_methodSignature methodReturnLength] == sizeof(id)) {
id result = nil;
void *tempResult;
[invocation getReturnValue:&tempResult];
result = (__bridge id)tempResult;
return result;
}

const char * retType = [_methodSignature methodReturnType];
char t = retType[0];
switch(t)
Expand All @@ -348,12 +340,26 @@ -(id)call:(NSArray*)args
{
return nil;
}
case '@':
{
id result = nil;
void *tempResult;
[invocation getReturnValue:&tempResult];
result = (__bridge id)tempResult;
return result;
}
case 'c':
{
char c;
[invocation getReturnValue:&c];
return [NSNumber numberWithChar:c];
}
case 'C':
{
unsigned char uc;
[invocation getReturnValue:&uc];
return [NSNumber numberWithUnsignedChar:uc];
}
case 'f':
{
float f;
Expand All @@ -366,6 +372,24 @@ -(id)call:(NSArray*)args
[invocation getReturnValue:&i];
return [NSNumber numberWithInt:i];
}
case 'I':
{
unsigned int ui;
[invocation getReturnValue:&ui];
return [NSNumber numberWithUnsignedInt:ui];
}
case 's':
{
short s;
[invocation getReturnValue:&s];
return [NSNumber numberWithShort:s];
}
case 'S':
{
unsigned short us;
[invocation getReturnValue:&us];
return [NSNumber numberWithUnsignedShort:us];
}
case 'd':
{
double d;
Expand All @@ -378,21 +402,33 @@ -(id)call:(NSArray*)args
[invocation getReturnValue:&l];
return [NSNumber numberWithLong:l];
}
case 'L':
{
unsigned long ul;
[invocation getReturnValue:&ul];
return [NSNumber numberWithUnsignedLong:ul];
}
case 'q':
{
long long l;
[invocation getReturnValue:&l];
return [NSNumber numberWithLongLong:l];
long long ll;
[invocation getReturnValue:&ll];
return [NSNumber numberWithLongLong:ll];
}
case 'Q':
{
unsigned long long l;
[invocation getReturnValue:&l];
return [NSNumber numberWithUnsignedLongLong:l];
unsigned long long ull;
[invocation getReturnValue:&ull];
return [NSNumber numberWithUnsignedLongLong:ull];
}
case 'b':
{
bool b;
[invocation getReturnValue:&b];
return [NSNumber numberWithBool:b];
}
default:
{
DeveloperLog(@"[ERROR] Unsupported primitive return type: %c for target:%@->%@",t,target,NSStringFromSelector(selector));
DebugLog(@"[ERROR] Unsupported primitive return type: %c for target:%@->%@",t,target,NSStringFromSelector(selector));
break;
}
}
Expand Down
1 change: 1 addition & 0 deletions iphone/headers/JavaScriptCore/TiBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ JS_EXPORT void TiGarbageCollect(TiContextRef ctx);
#endif

/* Enable the Objective-C API for platforms with a modern runtime. */
#define JSC_OBJC_API_ENABLED 0
#if !defined(JSC_OBJC_API_ENABLED)
#define JSC_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 && !defined(__i386__)) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)))
#endif
Expand Down

0 comments on commit ce0fbbb

Please sign in to comment.