X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Futil.hpp;h=e285c0f23d6848619c21a571dbd26a80d83f9675;hb=268111321e92c4366100924b2c0cd8a8c945885b;hp=253f656edc4636204b22036b943596025c7a2ca7;hpb=08d25dcc9db8ff5f3ef4456f056d3e89f70e4f1f;p=staging%2Fwindowmanager.git diff --git a/src/util.hpp b/src/util.hpp index 253f656..e285c0f 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -3,6 +3,7 @@ #include #include + #include extern "C" { @@ -32,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 + + // _ _ _ __ _ // ___| |_ _ __ _ _ ___| |_ _ _ _ __ (_) __ _ _ _ ___ / _| __| | // / __| __| '__| | | |/ __| __| | | | | '_ \| |/ _` | | | |/ _ \ | |_ / _` |