debugmacrosext.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // Copyright (c) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  4. //
  5. //*****************************************************************************
  6. // DebugMacrosExt.h
  7. //
  8. // Simple debugging macros that take no dependencies on CLR headers.
  9. // This header can be used from outside the CLR.
  10. //
  11. //*****************************************************************************
  12. #ifndef __DebugMacrosExt_h__
  13. #define __DebugMacrosExt_h__
  14. #if !defined(_DEBUG_IMPL) && defined(_DEBUG) && !defined(DACCESS_COMPILE)
  15. #define _DEBUG_IMPL 1
  16. #endif
  17. #ifdef _DEBUG
  18. // A macro to execute a statement only in _DEBUG.
  19. #define DEBUG_STMT(stmt) stmt
  20. #define INDEBUG(x) x
  21. #define INDEBUG_COMMA(x) x,
  22. #define COMMA_INDEBUG(x) ,x
  23. #define NOT_DEBUG(x)
  24. #else
  25. #define DEBUG_STMT(stmt)
  26. #define INDEBUG(x)
  27. #define INDEBUG_COMMA(x)
  28. #define COMMA_INDEBUG(x)
  29. #define NOT_DEBUG(x) x
  30. #endif
  31. #ifdef _DEBUG_IMPL
  32. #define INDEBUGIMPL(x) x
  33. #define INDEBUGIMPL_COMMA(x) x,
  34. #define COMMA_INDEBUGIMPL(x) ,x
  35. #else
  36. #define INDEBUGIMPL(x)
  37. #define INDEBUGIMPL_COMMA(x)
  38. #define COMMA_INDEBUGIMPL(x)
  39. #endif
  40. #endif