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.3 KiB

  1. //depot/private/homenet/net/homenet/Config/inc/HNCDbg.h#2 - edit change 5763 (text)
  2. //+---------------------------------------------------------------------------
  3. //
  4. // Microsoft Windows
  5. // Copyright (C) Microsoft Corporation, 1997 - 2000
  6. //
  7. // File: H N C D B G . H
  8. //
  9. // Contents: Home Networking Configuration debug routines
  10. //
  11. // Notes:
  12. //
  13. // Author: jonburs 13 June 2000
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. //
  18. // The standard CRT assertions do bad things such as displaying message boxes.
  19. // These macros will just print stuff out to the debugger. If you do want the
  20. // standard CRT assertions, just define _DEBUG before including this header
  21. //
  22. #ifdef DBG // checked build
  23. #ifndef _DEBUG // DEBUG_CRT is not enabled.
  24. #undef _ASSERT
  25. #undef _ASSERTE
  26. #define BUF_SIZE 512
  27. #define _ASSERT(expr) \
  28. do \
  29. { \
  30. if (!(expr)) \
  31. { \
  32. TCHAR buf[BUF_SIZE + 1]; \
  33. _sntprintf( \
  34. buf, \
  35. BUF_SIZE, \
  36. _T("HNetCfg: Assertion failed (%s:%i)\n"), \
  37. _T(__FILE__), \
  38. __LINE__ \
  39. ); \
  40. buf[BUF_SIZE] = _T('\0'); \
  41. OutputDebugString(buf); \
  42. DebugBreak(); \
  43. } \
  44. } while (0)
  45. #define _ASSERTE(expr) \
  46. do \
  47. { \
  48. if (!(expr)) \
  49. { \
  50. TCHAR buf[BUF_SIZE + 1]; \
  51. _sntprintf( \
  52. buf, \
  53. BUF_SIZE, \
  54. _T("HNetCfg: Assertion failed (%s:%i)\n"), \
  55. _T(__FILE__), \
  56. __LINE__ \
  57. ); \
  58. buf[BUF_SIZE] = _T('\0'); \
  59. OutputDebugString(buf); \
  60. DebugBreak(); \
  61. } \
  62. } while (0)
  63. #endif
  64. #endif