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.

93 lines
3.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: dbgsup.hxx
  7. //
  8. // Contents: Debugging declarations and macros
  9. //
  10. // History: 2-Nov-95 BruceFo Created
  11. //
  12. //--------------------------------------------------------------------------
  13. //
  14. // Fix the warning levels
  15. //
  16. #pragma warning(3:4092) // sizeof returns 'unsigned long'
  17. #pragma warning(3:4121) // structure is sensitive to alignment
  18. #pragma warning(3:4125) // decimal digit in octal sequence
  19. #pragma warning(3:4130) // logical operation on address of string constant
  20. #pragma warning(3:4132) // const object should be initialized
  21. #pragma warning(4:4200) // nonstandard zero-sized array extension
  22. #pragma warning(4:4206) // Source File is empty
  23. #pragma warning(3:4208) // delete[exp] - exp evaluated but ignored
  24. #pragma warning(3:4212) // function declaration used ellipsis
  25. #pragma warning(3:4220) // varargs matched remaining parameters
  26. #pragma warning(4:4509) // SEH used in function w/ _trycontext
  27. #pragma warning(error:4700) // Local used w/o being initialized
  28. #pragma warning(3:4706) // assignment w/i conditional expression
  29. #pragma warning(3:4709) // command operator w/o index expression
  30. //////////////////////////////////////////////////////////////////////////////
  31. #if DBG == 1
  32. DECLARE_DEBUG(DfsAdmin)
  33. #define appDebugOut(x) DfsAdminInlineDebugOut x
  34. #define appAssert(x) DebugAssert(x)
  35. #define CHECK_HRESULT(hr) \
  36. if ( FAILED(hr) ) \
  37. { \
  38. appDebugOut((DEB_ERROR, \
  39. "**** HRESULT ERROR RETURN <%s @line %d> -> 0x%08lx\n", \
  40. __FILE__, __LINE__, hr)); \
  41. }
  42. #define CHECK_NET_API_STATUS(status) \
  43. if ( (status) != NERR_Success ) \
  44. { \
  45. appDebugOut((DEB_ERROR, \
  46. "**** NET_API_STATUS ERROR RETURN <%s @line %d> -> 0x%08lx\n", \
  47. __FILE__, __LINE__, status)); \
  48. }
  49. #define CHECK_NEW(p) \
  50. if ( NULL == (p) ) \
  51. { \
  52. appDebugOut((DEB_ERROR, \
  53. "**** NULL POINTER (OUT OF MEMORY!) <%s @line %d>\n", \
  54. __FILE__, __LINE__)); \
  55. }
  56. #define CHECK_NULL(p) \
  57. if ( NULL == (p) ) \
  58. { \
  59. appDebugOut((DEB_ERROR, \
  60. "**** NULL POINTER <%s @line %d>: %s\n", \
  61. __FILE__, __LINE__, #p)); \
  62. }
  63. #define CHECK_THIS appAssert(NULL != this && "'this' pointer is NULL")
  64. #define DECLARE_SIG ULONG_PTR __sig
  65. #define INIT_SIG(class) __sig = SIG_##class
  66. #define CHECK_SIG(class) \
  67. appAssert((NULL != this) && "'this' pointer is NULL"); \
  68. appAssert((SIG_##class == __sig) && "Signature doesn't match")
  69. #else
  70. #define appDebugOut(x)
  71. #define appAssert(x)
  72. #define CHECK_HRESULT(hr)
  73. #define CHECK_NET_API_STATUS(status)
  74. #define CHECK_NEW(p)
  75. #define CHECK_NULL(p)
  76. #define CHECK_THIS
  77. #define DECLARE_SIG
  78. #define INIT_SIG(class)
  79. #define CHECK_SIG(class)
  80. #endif