summaryrefslogtreecommitdiff
path: root/tools/minicargo/debug.h
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-09-23 14:45:30 +0800
committerJohn Hodge <tpg@mutabah.net>2017-09-23 14:45:30 +0800
commit4d99850792a83b0416459ed930403304f450f8f6 (patch)
treebbc0178c0ba6ff865c9d9117d63f603c9227b676 /tools/minicargo/debug.h
parentcfb45e3564ebfedc4b40adcf53286f9737f8d25e (diff)
parent69e7babc3bf5e7cfa86295bfa4cb139b79627a8b (diff)
downloadmrust-4d99850792a83b0416459ed930403304f450f8f6.tar.gz
Merge branch 'master' of ssh://github.com/thepowersgang/mrustc
Diffstat (limited to 'tools/minicargo/debug.h')
-rw-r--r--tools/minicargo/debug.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/minicargo/debug.h b/tools/minicargo/debug.h
index 00cd1412..f723d359 100644
--- a/tools/minicargo/debug.h
+++ b/tools/minicargo/debug.h
@@ -9,9 +9,15 @@ extern void Debug_EnterScope(const char* name, dbg_cb_t );
extern void Debug_LeaveScope(const char* name, dbg_cb_t );
extern void Debug_Print(dbg_cb_t cb);
-#define DEBUG(fmt) do { Debug_Print([&](auto& os){ os << "DEBUG: " << fmt; }); } while(0)
-#define TODO(fmt) do { Debug_Print([&](auto& os){ os << "TODO: " << fmt; }); abort(); } while(0)
-#define TRACE_FUNCTION_F(fmt) DebugFunctionScope trace_function_hdr { __FUNCTION__, [&](auto& os){ os << fmt; } }
+#if defined(NOLOG)
+# define DEBUG(fmt) do { } while(0)
+# define TODO(fmt) do { } while(0)
+# define TRACE_FUNCTION_F(fmt) do{}while(0)
+#else
+# define DEBUG(fmt) do { Debug_Print([&](auto& os){ os << "DEBUG: " << fmt; }); } while(0)
+# define TODO(fmt) do { Debug_Print([&](auto& os){ os << "TODO: " << fmt; }); abort(); } while(0)
+# define TRACE_FUNCTION_F(fmt) DebugFunctionScope trace_function_hdr { __FUNCTION__, [&](auto& os){ os << fmt; } }
+#endif
namespace {
static inline void format_to_stream(::std::ostream& os) {