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:
Indragie Karunaratne 2014-03-10 22:09:02 -06:00
parent 4fa43bd41c
commit ab08e149e2

View file

@ -108,8 +108,13 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
static NSData *AFSecKeyGetData(SecKeyRef key) {
CFDataRef data = NULL;
#if defined(NS_BLOCK_ASSERTIONS)
SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data);
#else
OSStatus status = SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data);
NSCAssert(status == errSecSuccess, @"SecItemExport error: %ld", (long int)status);
#endif
NSCParameterAssert(data);
return (__bridge_transfer NSData *)data;