Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.1 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: ssdebug.h
  3. *
  4. * Debugging stuff
  5. *
  6. * Copyright (c) 1996 Microsoft Corporation
  7. *
  8. \**************************************************************************/
  9. #ifndef __ssdebug_h__
  10. #define __ssdebug_h__
  11. ULONG DbgPrint(PCH Format, ...);
  12. #define SS_LEVEL_ERROR 1L
  13. #define SS_LEVEL_INFO 2L
  14. #define SS_LEVEL_ENTRY 8L
  15. #if DBG
  16. extern long ssDebugMsg;
  17. extern long ssDebugLevel;
  18. #define SS_DBGPRINT( str ) DbgPrint("SS: " str )
  19. #define SS_DBGPRINT1( str, a ) DbgPrint("SS: " str, a )
  20. #define SS_DBGPRINT2( str, a, b ) DbgPrint("SS: " str, a, b )
  21. #define SS_WARNING(str) DbgPrint("SS: " str )
  22. #define SS_WARNING1(str,a) DbgPrint("SS: " str,a)
  23. #define SS_WARNING2(str,a,b) DbgPrint("SS: " str,a,b)
  24. #define SS_RIP(str) {SS_WARNING(str); DebugBreak();}
  25. #define SS_RIP1(str,a) {SS_WARNING1(str,a); DebugBreak();}
  26. #define SS_RIP2(str,a,b) {SS_WARNING2(str,a,b); DebugBreak();}
  27. #define SS_ASSERT(expr,str) if(!(expr)) SS_RIP(str)
  28. #define SS_ASSERT1(expr,str,a) if(!(expr)) SS_RIP1(str,a)
  29. #define SS_ASSERT2(expr,str,a,b) if(!(expr)) SS_RIP2(str,a,b)
  30. #define SS_ALLOC_FAILURE(str) \
  31. DbgPrint( "%s : Memory allocation failure\n", str );
  32. #define SS_DBGMSG( str ) if( ssDebugMsg ) SS_DBGPRINT( str )
  33. #define SS_DBGMSG1( str, a ) if( ssDebugMsg ) SS_DBGPRINT1( str, a )
  34. #define SS_DBGMSG2( str, a, b ) if( ssDebugMsg ) SS_DBGPRINT2( str, a, b )
  35. //
  36. // Use SS_DBGLEVEL for general purpose debug messages gated by an
  37. // arbitrary warning level.
  38. //
  39. #define SS_DBGLEVEL(n,str) if (ssDebugLevel >= (n)) SS_DBGPRINT(str)
  40. #define SS_DBGLEVEL1(n,str,a) if (ssDebugLevel >= (n)) SS_DBGPRINT1(str,a)
  41. #define SS_DBGLEVEL2(n,str,a,b) if (ssDebugLevel >= (n)) SS_DBGPRINT2(str,a,b)
  42. #define SS_ERROR(str) SS_DBGLEVEL( SS_LEVEL_ERROR, str )
  43. #define SS_ERROR1(str,a) SS_DBGLEVEL1( SS_LEVEL_ERROR, str, a )
  44. #define SS_ERROR2(str,a) SS_DBGLEVEL2( SS_LEVEL_ERROR, str, a, b )
  45. #define SS_DBGINFO(str) SS_DBGLEVEL( SS_LEVEL_INFO, str )
  46. #define SS_DBGINFO1(str,a) SS_DBGLEVEL1( SS_LEVEL_INFO, str, a )
  47. #define SS_DBGINFO2(str,a,b) SS_DBGLEVEL2( SS_LEVEL_INFO, str, a, b )
  48. #else
  49. #define SS_DBGPRINT( str )
  50. #define SS_DBGPRINT1( str, a )
  51. #define SS_DBGPRINT2( str, a, b )
  52. #define SS_WARNING(str)
  53. #define SS_WARNING1(str,a)
  54. #define SS_WARNING2(str,a,b)
  55. #define SS_RIP(str)
  56. #define SS_RIP1(str,a)
  57. #define SS_RIP2(str,a,b)
  58. #define SS_ASSERT(expr,str) assert( expr )
  59. #define SS_ASSERT1(expr,str,a) assert( expr )
  60. #define SS_ASSERT2(expr,str,a,b) assert( expr )
  61. #define SS_ALLOC_FAILURE(str)
  62. #define SS_DBGMSG( str )
  63. #define SS_DBGMSG1( str, a )
  64. #define SS_DBGMSG2( str, a, b )
  65. #define SS_DBGLEVEL(n,str)
  66. #define SS_DBGLEVEL1(n,str,a)
  67. #define SS_DBGLEVEL2(n,str,a,b)
  68. #define SS_ERROR(str)
  69. #define SS_ERROR1(str,a)
  70. #define SS_ERROR2(str,a,b)
  71. #define SS_DBGINFO(str)
  72. #define SS_DBGINFO1(str,a)
  73. #define SS_DBGINFO2(str,a,b)
  74. #endif // DBG
  75. #endif // __ssdebug_h__