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.

73 lines
2.3 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: debug.h
  3. *
  4. * MCD debugging macros.
  5. *
  6. * Created: 23-Jan-1996 14:40:34
  7. * Author: Gilman Wong [gilmanw]
  8. *
  9. * Copyright (c) 1992 Microsoft Corporation
  10. *
  11. \**************************************************************************/
  12. #ifndef __DEBUG_H__
  13. #define __DEBUG_H__
  14. void DbgBreakPoint();
  15. ULONG DbgPrint(PCH Format, ...);
  16. #if DBG
  17. #define MCDDEBUG_DISABLE_ALLOCBUF 0x00000001
  18. #define MCDDEBUG_DISABLE_GETBUF 0x00000002
  19. #define MCDDEBUG_DISABLE_PROCBATCH 0x00000004
  20. #define MCDDEBUG_DISABLE_CLEAR 0x00000008
  21. // These debug macros are useful for assertions.
  22. #define WARNING(str) DbgPrint("%s(%d): " str,__FILE__,__LINE__)
  23. #define WARNING1(str,a) DbgPrint("%s(%d): " str,__FILE__,__LINE__,a)
  24. #define WARNING2(str,a,b) DbgPrint("%s(%d): " str,__FILE__,__LINE__,a,b)
  25. #define WARNING3(str,a,b,c) DbgPrint("%s(%d): " str,__FILE__,__LINE__,a,b,c)
  26. #define WARNING4(str,a,b,c,d) DbgPrint("%s(%d): " str,__FILE__,__LINE__,a,b,c,d)
  27. #define RIP(str) {WARNING(str); DbgBreakPoint();}
  28. #define RIP1(str,a) {WARNING1(str,a); DbgBreakPoint();}
  29. #define RIP2(str,a,b) {WARNING2(str,a,b); DbgBreakPoint();}
  30. #define ASSERTOPENGL(expr,str) if(!(expr)) RIP(str)
  31. #define ASSERTOPENGL1(expr,str,a) if(!(expr)) RIP1(str,a)
  32. #define ASSERTOPENGL2(expr,str,a,b) if(!(expr)) RIP2(str,a,b)
  33. //
  34. // Use DBGPRINT for general purpose debug message.
  35. //
  36. #define DBGPRINT(str) DbgPrint("MCD: " str)
  37. #define DBGPRINT1(str,a) DbgPrint("MCD: " str,a)
  38. #define DBGPRINT2(str,a,b) DbgPrint("MCD: " str,a,b)
  39. #define DBGPRINT3(str,a,b,c) DbgPrint("MCD: " str,a,b,c)
  40. #define DBGPRINT4(str,a,b,c,d) DbgPrint("MCD: " str,a,b,c,d)
  41. #define DBGPRINT5(str,a,b,c,d,e) DbgPrint("MCD: " str,a,b,c,d,e)
  42. #else
  43. #define WARNING(str)
  44. #define WARNING1(str,a)
  45. #define WARNING2(str,a,b)
  46. #define WARNING3(str,a,b,c)
  47. #define WARNING4(str,a,b,c,d)
  48. #define RIP(str)
  49. #define RIP1(str,a)
  50. #define RIP2(str,a,b)
  51. #define ASSERTOPENGL(expr,str)
  52. #define ASSERTOPENGL1(expr,str,a)
  53. #define ASSERTOPENGL2(expr,str,a,b)
  54. #define DBGPRINT(str)
  55. #define DBGPRINT1(str,a)
  56. #define DBGPRINT2(str,a,b)
  57. #define DBGPRINT3(str,a,b,c)
  58. #define DBGPRINT4(str,a,b,c,d)
  59. #define DBGPRINT5(str,a,b,c,d,e)
  60. #endif
  61. #endif /* __DEBUG_H__ */