Same fix as 6c7250e for 1.x branch
Wrapping OSStatus and NSCAssert with NS_BLOCK_ASSERTIONS macro to prevent unused variable
This commit is contained in:
parent
4fa43bd41c
commit
ab08e149e2
1 changed files with 5 additions and 0 deletions
|
|
@ -108,8 +108,13 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
static NSData *AFSecKeyGetData(SecKeyRef key) {
|
static NSData *AFSecKeyGetData(SecKeyRef key) {
|
||||||
CFDataRef data = NULL;
|
CFDataRef data = NULL;
|
||||||
|
|
||||||
|
#if defined(NS_BLOCK_ASSERTIONS)
|
||||||
|
SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data);
|
||||||
|
#else
|
||||||
OSStatus status = SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data);
|
OSStatus status = SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data);
|
||||||
NSCAssert(status == errSecSuccess, @"SecItemExport error: %ld", (long int)status);
|
NSCAssert(status == errSecSuccess, @"SecItemExport error: %ld", (long int)status);
|
||||||
|
#endif
|
||||||
|
|
||||||
NSCParameterAssert(data);
|
NSCParameterAssert(data);
|
||||||
|
|
||||||
return (__bridge_transfer NSData *)data;
|
return (__bridge_transfer NSData *)data;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue