Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Side by Side Diff: third_party/ocmock/OCMock/OCMBoxedReturnValueProvider.m

Issue 177373009: Compatibility fix for arm64 on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ocmock.0
Patch Set: Rebase Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //------------------------------------------------------------------------------ --------- 1 //------------------------------------------------------------------------------ ---------
2 // $Id$ 2 // $Id$
3 // Copyright (c) 2009 by Mulle Kybernetik. See License file for details. 3 // Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
4 //------------------------------------------------------------------------------ --------- 4 //------------------------------------------------------------------------------ ---------
5 5
6 #import "OCMBoxedReturnValueProvider.h" 6 #import "OCMBoxedReturnValueProvider.h"
7 7
8 8
9 @implementation OCMBoxedReturnValueProvider 9 @implementation OCMBoxedReturnValueProvider
10 10
11 - (void)handleInvocation:(NSInvocation *)anInvocation 11 - (void)handleInvocation:(NSInvocation *)anInvocation
12 { 12 {
13 » if(strcmp([[anInvocation methodSignature] methodReturnType], [(NSValue * )returnValue objCType]) != 0) 13 » const char* returnType = [[anInvocation methodSignature] methodReturnTyp e];
14 » const char* valueType = [(NSValue *)returnValue objCType];
15 » // ARM64 uses 'B' for BOOLS in method signatures but 'c' in NSValue; tha t case should match.
16 » if(strcmp(returnType, valueType) != 0 && !(strcmp(returnType, "B") == 0 && strcmp(valueType, "c") == 0))
14 @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Return value does not match method signature." userInfo:nil]; 17 @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"Return value does not match method signature." userInfo:nil];
15 void *buffer = malloc([[anInvocation methodSignature] methodReturnLength ]); 18 void *buffer = malloc([[anInvocation methodSignature] methodReturnLength ]);
16 [returnValue getValue:buffer]; 19 [returnValue getValue:buffer];
17 [anInvocation setReturnValue:buffer]; 20 [anInvocation setReturnValue:buffer];
18 free(buffer); 21 free(buffer);
19 } 22 }
20 23
21 @end 24 @end
OLDNEW
« no previous file with comments | « third_party/ocmock/OCMock/NSInvocation+OCMAdditions.m ('k') | third_party/ocmock/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698