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.

85 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. dbgspl.hxx
  6. Abstract:
  7. Debug Library spooler compatible macros.
  8. Author:
  9. Steve Kiraly (SteveKi) 21-July-1998
  10. Revision History:
  11. --*/
  12. #ifndef _DBGSPL_HXX_
  13. #define _DBGSPL_HXX_
  14. #if defined(DBG) && defined(SPOOLER_COMPATIBLE)
  15. #define DBGMSG( uLevel, Msg ) \
  16. DBG_MSG( uLevel, Msg )
  17. #define SPLASSERT( Exp ) \
  18. do { if (!(Exp)) \
  19. {\
  20. DBG_MSG( kDbgAlways|kDbgNoFileInfo, ( _T("Assert %s\n%s %d\n"), _T( #Exp ), _T(__FILE__), __LINE__ ) ); \
  21. DBG_BREAK(); \
  22. } } while (0)
  23. #define DBGSTR( str ) \
  24. ((str) ? (str) : _T("(NULL)"))
  25. #ifdef UNICODE
  26. #define TSTR "%ws"
  27. #else // not Unicode
  28. #define TSTR "%s"
  29. #endif // Unicode
  30. #define MODULE_DEBUG_INIT( x, y ) // Empty
  31. #define VALID_PTR(x) \
  32. ((( x ) && (( x )->bValid( ))) ? TRUE :\
  33. DBG_MSG( kDbgAlways|kDbgNoFileInfo, ( _T("Invalid Object: %x\n%s %d\n"), ( x ), _T(__FILE__), __LINE__ ) ), FALSE )
  34. #define VALID_OBJ(x) \
  35. ((( x ).bValid( )) ? TRUE :\
  36. DBG_MSG( kDbgAlways|kDbgNoFileInfo, ( _T("Invalid Object: %x\n%s %d\n"), ( &x ), _T(__FILE__), __LINE__ ) ), FALSE )
  37. #define VALID_BASE(x) \
  38. (( x::bValid( )) ? TRUE :\
  39. DBG_MSG( kDbgAlways|kDbgNoFileInfo, ( _T("Invalid Object: %x\n%s %d\n"), ( &x ), _T(__FILE__), __LINE__ ) ), FALSE )
  40. #elseif !defined(DBG) && defined(SPOOLER_COMPATIBLE)
  41. #define DBGMSG( uLevel, Message ) // Empty
  42. #define SPLASSERT( Exp ) // Empty
  43. #define DBGSTR( str ) // Empty
  44. #define MODULE_DEBUG_INIT( x, y ) // Empty
  45. #define VALID_PTR(x) \
  46. (( x ) && (( x )->bValid()))
  47. #define VALID_OBJ(x) \
  48. (( x ).bValid())
  49. #define VALID_BASE(x) \
  50. ( x::bValid( ))
  51. #endif // DBG
  52. #endif // DBGSPL_HXX