Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Core Audio result checking

By: a guest on Aug 21st, 2012  |  syntax: Objective C  |  size: 0.40 KB  |  views: 53  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }