From a687c62a8d53ded7b50a64d3c3b7eeb07800af30 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 13 Aug 2026 12:18:06 +0000 Subject: fix --- util.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'util.h') diff --git a/util.h b/util.h index 1477d3b..05eb118 100644 --- a/util.h +++ b/util.h @@ -19,12 +19,14 @@ namespace ov4 { void atomic_print(char *s); void atomic_print(int x); +void atomic_debug(char *s); +void atomic_debug(int x); bool isnum(char *s); void reverse(char str[], int length); char* itoa(int num, char* str, int base); constexpr bool GLOBAL_DEBUG = true; -bool DEBUG = true; // verbose mode, can be enabled on demand using something like -v +bool DEBUG = false; // verbose mode, can be enabled on demand using something like -v struct LogVoidify { void operator&(std::ostream&) const {} }; const int DECIMAL = 10; @@ -55,6 +57,16 @@ void reverse(char str[], int length) } } +void atomic_debug(char *s) +{ + if (DEBUG && GLOBAL_DEBUG) atomic_print(s); +} + +void atomic_debug(int x) +{ + if (DEBUG && GLOBAL_DEBUG) atomic_print(x); +} + bool isnum(char *s) { for (int i = 0; s[i] != 0; i++) -- cgit v1.3.1-4-g156e