From f233715b70445cb7af37212f2f9c65aee97b1613 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 18 Jun 2024 02:35:45 +0300 Subject: [PATCH] BAN: Add d{print,want,error}ln_if macros for userspace --- BAN/include/BAN/Debug.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/BAN/include/BAN/Debug.h b/BAN/include/BAN/Debug.h index 5ed01617cb..c0fd529a43 100644 --- a/BAN/include/BAN/Debug.h +++ b/BAN/include/BAN/Debug.h @@ -34,4 +34,22 @@ fflush(stddbg); \ } while(false) +#define dprintln_if(cond, ...) \ + do { \ + if constexpr(cond) \ + dprintln(__VA_ARGS__); \ + } while(false) + +#define dwarnln_if(cond, ...) \ + do { \ + if constexpr(cond) \ + dwarnln(__VA_ARGS__); \ + } while(false) + +#define derrorln_if(cond, ...) \ + do { \ + if constexpr(cond) \ + derrorln(__VA_ARGS__); \ + } while(false) + #endif