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