summaryrefslogtreecommitdiff
path: root/tools/msgenc/util.h
diff options
context:
space:
mode:
authorAkira Akashi <rubenru09@aol.com>2021-08-31 02:39:54 +0100
committerGitHub <noreply@github.com>2021-08-31 02:39:54 +0100
commit1cf55e2cfc9bf8bbe9283b15fd82b1676aa763f0 (patch)
treeaeffcccc4fac0f49d5d4f25ee5c036ea42d2c9b1 /tools/msgenc/util.h
parent81321acc0af32f5289125b8c1322b9c8a4de8a20 (diff)
parent05ded46ab7f556956a2eee2411a8d2968b7e8ad6 (diff)
Merge branch 'master' into unk_02006D98
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