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.

71 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1997
  6. //
  7. // File: dbgutil.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /////////////////////////////////////////////////////////////////////
  11. // DbgUtil.h
  12. //
  13. // Handy debugging macros.
  14. //
  15. // HISTORY
  16. // 19-Jun-97 t-danm Creation.
  17. /////////////////////////////////////////////////////////////////////
  18. #ifndef APIERR
  19. typedef DWORD APIERR; // Error code typically returned by ::GetLastError()
  20. #endif
  21. /////////////////////////////////////////////////////////////////////
  22. //
  23. // Dummy macros
  24. //
  25. #define INOUT // Parameter is both input and output
  26. #define IGNORED // Output parameter is ignored
  27. /////////////////////////////////////////////////////////////////////
  28. //
  29. // Handy macros
  30. //
  31. #ifdef DEBUG
  32. #define DebugCode(x) x
  33. #define GarbageInit(pv, cb) memset(pv, 'a', cb)
  34. #else
  35. #define DebugCode(x)
  36. #define GarbageInit(pv, cb)
  37. #endif
  38. /////////////////////////////////////////////////////////////////////
  39. #define Assert(x) ASSERT(x)
  40. /////////////////////////////////////////////////////////////////////
  41. // Report is an unsual situation. This is somewhat similar
  42. // to an assert but does not always represent a code bug.
  43. // eg: Unable to load an icon.
  44. //
  45. #define Report(x) ASSERT(x) // Currently defined as an assert because I don't have time to rewrite another macro
  46. /////////////////////////////////////////////////////////////////////
  47. // Macro Endorse()
  48. //
  49. // This macro is mostly used when validating parameters.
  50. // Some parameters are allowed to be NULL because they are optional
  51. // or simply because the interface uses the NULL case as a valid
  52. // input parameter. In this case the Endorse() macro is used to
  53. // acknowledge the validity of such a parameter.
  54. //
  55. // REMARKS
  56. // This macro is the opposite of Assert().
  57. //
  58. // EXAMPLE
  59. // Endorse(p == NULL); // Code acknowledge p == NULL to not be (or not cause) an error
  60. //
  61. #define Endorse(x)