diff options
Diffstat (limited to 'util.h')
| -rw-r--r-- | util.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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++) |
