ptdebug.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 1k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. //-------------------------------------------------------------------------//
  2. //
  3. //  PTdebug.h
  4. //
  5. //  Common debugging helpers for Property Tree modules
  6. //
  7. //-------------------------------------------------------------------------//
  8. #ifndef __PTDEBUG_H__
  9. #define __PTDEBUG_H__
  10. #ifdef _DEBUG
  11. #   define _ENABLE_TRACING
  12. #   define _ENABLE_ASSERT
  13. #endif
  14. //-------------------------------------------------------------------------//
  15. //  TRACE()
  16. #if defined(_ENABLE_TRACING) && !defined(TRACE)
  17.     void _cdecl DebugTrace(LPCTSTR lpszFormat, ...);
  18. #   ifndef TRACE
  19. #       define TRACE            DebugTrace
  20. #   endif
  21. #else
  22.     inline void _cdecl DebugTrace(LPCTSTR , ...){}
  23. #   ifndef TRACE
  24. #       define TRACE            1 ? (void)0 : DebugTrace
  25. #   endif
  26. #endif 
  27. //-------------------------------------------------------------------------//
  28. //-------------------------------------------------------------------------//
  29. //  ASSERT(), VERIFY()
  30. #if defined(_ENABLE_ASSERT) && !defined(ASSERT)
  31. #   include <crtdbg.h>
  32. #   define ASSERT( expr )  _ASSERTE( expr )
  33. #   define VERIFY( expr )  ASSERT( expr )
  34. #else
  35. #   define ASSERT( expr )    
  36. #   define VERIFY( expr )  ((void)(expr))
  37. #endif
  38. //-------------------------------------------------------------------------//
  39. #endif