summaryrefslogtreecommitdiff
path: root/debug.h
diff options
context:
space:
mode:
authorTom Harley2019-12-23 01:32:39 +0000
committerTom Harley2019-12-23 01:32:39 +0000
commit7bc67b95161a34f8eca635d4000d9602508a9243 (patch)
tree585b3778dc1967832390e5829e4b3909b4184a2c /debug.h
parentAdd basics for interpreter; add CLI options (diff)
downloadsinter-7bc67b95161a34f8eca635d4000d9602508a9243.tar.gz
sinter-7bc67b95161a34f8eca635d4000d9602508a9243.zip

checkpoint

Diffstat (limited to 'debug.h')
-rw-r--r--debug.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/debug.h b/debug.h
index 2e04745..4b67b0a 100644
--- a/debug.h
+++ b/debug.h
@@ -3,6 +3,12 @@
#include <stdio.h>
-#define debug(...) fprintf(stderr, __VA_ARGS__)
+extern int verbose;
+
+#define debug(...) do { \
+ if (verbose) { \
+ fprintf(stderr, __VA_ARGS__); \
+ } \
+} while (0)
#endif /* DEBUG_H */