summaryrefslogtreecommitdiff
path: root/tools/msgenc/util.h
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2021-08-31 08:54:33 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2021-08-31 08:54:33 -0400
commitba5f5449a4fb7c36a20ebccb0aa560d88d6a49c0 (patch)
tree63e5cab56041641b85b231f09296d1cecf9e0a1c /tools/msgenc/util.h
parentcc891865fa1eb5a823f6a3eeb1746f05addb0d90 (diff)
parent1499e9f8be9458bbf94cbc4dc6d1034f53606cd0 (diff)
Merge branch 'pikalax_work' of github.com:PikalaxALT/pokediamond into pikalax_work
Diffstat (limited to 'tools/msgenc/util.h')
-rw-r--r--tools/msgenc/util.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/msgenc/util.h b/tools/msgenc/util.h
new file mode 100644
index 00000000..5c93f4ca
--- /dev/null
+++ b/tools/msgenc/util.h
@@ -0,0 +1,17 @@
+#ifndef GUARD_UTIL_H
+#define GUARD_UTIL_H
+
+#include <cstdio>
+#include <cstdarg>
+
+static inline __attribute__((format(printf, 1, 2))) void debug_printf(const char * fmt, ...) {
+#ifndef NDEBUG
+ fputs("DEBUG: ", stderr);
+ va_list va_args;
+ va_start(va_args, fmt);
+ vfprintf(stderr, fmt, va_args);
+ va_end(va_args);
+#endif //NDEBUG
+}
+
+#endif //GUARD_UTIL_H