diff options
-rw-r--r-- | tools/minicargo/debug.h | 12 | ||||
-rw-r--r-- | tools/minicargo/toml.cpp | 1 |
2 files changed, 10 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) { diff --git a/tools/minicargo/toml.cpp b/tools/minicargo/toml.cpp index a33114c6..9fad0ec4 100644 --- a/tools/minicargo/toml.cpp +++ b/tools/minicargo/toml.cpp @@ -1,6 +1,7 @@ /* * A very bad streaming TOML parser */ +#define NOLOG #include "toml.h" #include "debug.h" #include <cassert> |