// =========================================================================== // UAMDebug.h © 1997 Microsoft Corp. All rights reserved. // =========================================================================== // Debugging routines for MS UAM. // =========================================================================== #pragma once #include "UAMUtils.h" #include #include #include #ifdef UAMDebug #define DBGBUFF _buff,sizeof(_buff) #ifdef UAM_TARGET_CARBON #define DbgPrint_(x) do { \ char _buff[256]; \ StringCbPrintf x; \ printf("%s%s", _buff, "\n"); \ }while(false) #else #define DbgPrint_(x) do { \ char _buff[256]; \ StringCbPrintf x; \ StringCbCat(_buff, sizeof(_buff), ";"); \ StringCbCat(_buff, sizeof(_buff), "g"); \ DebugStr(_c2pstr(_buff)); \ }while(false) #endif //UAM_TARGET_CARBON #define Assert_(test) do { \ if (!(test)) { \ DbgPrint_((DBGBUFF, "Assertion failed: (%s) file: %s line: %d", \ #test, __FILE__, __LINE__)); \ } \ }while(false) #define DBGPrintIfOSErr_(err) if (err != noErr) { \ DbgPrint_((DBGBUFF, "OSErr: %d, line: %d file: %s", \ err, __LINE__, __FILE__)); \ } #else #define DbgPrint_(x) #define Assert_(test) #define DBGPrintIfOSErr_(err) #endif