Skip to content

Commit

Permalink
KWSpec: Cast objc_msgSend for 64-bit device.
Browse files Browse the repository at this point in the history
  • Loading branch information
modocache committed Mar 14, 2014
1 parent 5c5e1b9 commit c645a76
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Classes/Core/KWSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,18 @@ - (void)invokeTest {

- (void)example:(KWExample *)example didFailWithFailure:(KWFailure *)failure {
if ([self respondsToSelector:@selector(recordFailureWithDescription:inFile:atLine:expected:)]) {
objc_msgSend(self,
@selector(recordFailureWithDescription:inFile:atLine:expected:),
[[failure exceptionValue] description],
failure.callSite.filename,
failure.callSite.lineNumber,
NO);
void (*recordFailure)(id, SEL, NSString *, NSString *, NSUInteger, BOOL) =
(void (*)(id, SEL, NSString *, NSString *, NSUInteger, BOOL))objc_msgSend;
recordFailure(self,
@selector(recordFailureWithDescription:inFile:atLine:expected:),
[[failure exceptionValue] description],
failure.callSite.filename,
failure.callSite.lineNumber,
NO);
} else {
objc_msgSend(self, @selector(failWithException:), [failure exceptionValue]);
void (*failWithException)(id, SEL, NSException *) =
(void (*)(id, SEL, NSException *))objc_msgSend;
failWithException(self, @selector(failWithException:), [failure exceptionValue]);
}
}

Expand Down

0 comments on commit c645a76

Please sign in to comment.