diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-07-27 15:49:50 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-08 17:24:00 +0200 |
commit | 462202c1187be467b8f002c8eaec1a3d42d01a1a (patch) | |
tree | 90d4cbe99f092ef3a2ad0ea3f9ec116ae470742e /src/util.hpp | |
parent | f8b41b5834be28af1dfc5ce1763a2a637506bef3 (diff) |
util: move DB() debug macro from app
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/util.hpp')
-rw-r--r-- | src/util.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.hpp b/src/util.hpp index 84c2462..e285c0f 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -33,6 +33,18 @@ extern "C" { #define logdebug(...) #endif +#ifndef NDEBUG +#define DB(expr) \ + do { \ + std::ostringstream o; \ + o << __FILE__ << ":" << __LINE__ << ":" << __func__ << ": " << expr; \ + logdebug("%s", o.str().c_str()); \ + } while (0) +#else +#define DB(expr) +#endif + + // _ _ _ __ _ // ___| |_ _ __ _ _ ___| |_ _ _ _ __ (_) __ _ _ _ ___ / _| __| | // / __| __| '__| | | |/ __| __| | | | | '_ \| |/ _` | | | |/ _ \ | |_ / _` | |