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.

59 lines
1.5 KiB

  1. #ifndef __SHCOMPUI_DEBUG_H
  2. #define __SHCOMPUI_DEBUG_H
  3. ///////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1995.
  7. //
  8. // FILE: DEBUG.H
  9. //
  10. // DESCRIPTION:
  11. //
  12. // Header for debug support in SHCOMPUI.DLL.
  13. //
  14. //
  15. // REVISIONS:
  16. //
  17. // Date Description Programmer
  18. // ---------- --------------------------------------------------- ----------
  19. // 09/15/95 Initial creation. brianau
  20. //
  21. ///////////////////////////////////////////////////////////////////////////////
  22. #ifdef ASSERT
  23. # undef ASSERT
  24. #endif
  25. #if defined(DEBUG) || defined(DBG)
  26. #include <windows.h>
  27. #include <tchar.h>
  28. void WINAPI AssertFailed(LPCTSTR szFile, int line);
  29. #ifdef UNICODE
  30. #define ASSERT(f) \
  31. { \
  32. if (!(f)) { \
  33. TCHAR szFile[MAX_PATH]; \
  34. MultiByteToWideChar(CP_ACP,0,__FILE__,-1,szFile,MAX_PATH); \
  35. AssertFailed(szFile, __LINE__); \
  36. } \
  37. }
  38. #else
  39. #define ASSERT(f) \
  40. { \
  41. if (!(f)) \
  42. AssertFailed((LPCTSTR)__FILE__, __LINE__); \
  43. }
  44. #endif
  45. #else
  46. #define ASSERT(f) (NULL) // No action.
  47. #endif
  48. void DbgOut(LPCTSTR fmt, ...);
  49. #endif
  50.