From 0004ca2c419f7f144567c4d0ba5ee0bedf4daab1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 21 Jun 2022 21:46:28 -0600 Subject: [PATCH] add useful DEBUG_RESULT and DEBUG_RESULT_CAST to pbd/debug.h --- libs/pbd/pbd/debug.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/pbd/pbd/debug.h b/libs/pbd/pbd/debug.h index abb2863afd..9d89322eb5 100644 --- a/libs/pbd/pbd/debug.h +++ b/libs/pbd/pbd/debug.h @@ -92,7 +92,13 @@ namespace PBD { #define DEBUG_TIMING_ADD_ELAPSED(bits,td) if (DEBUG_ENABLED (bits)) { td.add_elapsed (); } #define DEBUG_TIMING_RESET(bits,td) if (DEBUG_ENABLED (bits)) { td.reset (); } +#define DEBUG_RESULT(type,var,...) type var = __VA_ARGS__ +#define DEBUG_RESULT_CAST(type,var,cast_expr,...) type var = cast_expr __VA_ARGS__ +#define DEBUG_ASSIGN(var,expr) var = expr + #else + + #define DEBUG_TRACE(bits,fmt,...) /*empty*/ #define DEBUG_STR(a) /* empty */ #define DEBUG_STR_APPEND(a,b) /* empty */ @@ -103,6 +109,9 @@ namespace PBD { #define DEBUG_TIMING_ADD_ELAPSED(bits,td) /*empty*/ #define DEBUG_TIMING_RESET(bits,td) /*empty*/ +#define DEBUG_RESULT(type,var,...) __VA_ARGS__ +#define DEBUG_RESULT_CAST(type,var,cast_expr,...) __VA_ARGS__ +#define DEBUG_ASSIGN(var,expr) #endif #endif /* __libpbd_debug_h__ */