SHARE
TWEET

Core Audio result checking

a guest Aug 21st, 2012 56 Never
  1. #define checkResult(result,operation) (_checkResult((result),(operation),strrchr(__FILE__, '/'),__LINE__))
  2.  
  3. static inline BOOL _checkResult(OSStatus result, const char *operation, const char* file, int line) {
  4.     if ( result != noErr ) {
  5.         NSLog(@"%s:%d: %s result %d %08X %4.4s\n", file, line, operation, (int)result, (int)result, (char*)&result);
  6.         return NO;
  7.     }
  8.     return YES;
  9. }
RAW Paste Data
Top