aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-08-13 12:18:06 +0000
committer_ov4 <ov4@ov4.org>2026-08-13 12:18:06 +0000
commita687c62a8d53ded7b50a64d3c3b7eeb07800af30 (patch)
tree97e28d868aaa9298f099ce83e94283a1db84d31a /util.h
parent29843465a2621fc1dcb28ca5c4c6684c9f75930e (diff)
fix
Diffstat (limited to 'util.h')
-rw-r--r--util.h14
1 files changed, 13 insertions, 1 deletions
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++)