From 581cf00ee8366eef69611f03a082e8b17c3df520 Mon Sep 17 00:00:00 2001 From: Junxiao Shi Date: Mon, 18 Jul 2016 11:48:20 -0700 Subject: [PATCH] core: fix NFD_LOG compilation error with Boost 1.59 refs #3674 Change-Id: I58ea54478cc333fbfb57c8319d0ccd94c944c75f --- core/logger.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/logger.hpp b/core/logger.hpp index e7fa884a..24ec63c2 100644 --- a/core/logger.hpp +++ b/core/logger.hpp @@ -140,13 +140,20 @@ template<> template<> \ ::nfd::Logger& cls::g_logger = ::nfd::LoggerFactory::create(name) +#if (BOOST_VERSION >= 105900) && (BOOST_VERSION < 106000) +// workaround Boost bug 11549 +#define NFD_BOOST_LOG(x) BOOST_LOG(x) << "" +#else +#define NFD_BOOST_LOG(x) BOOST_LOG(x) +#endif + #define NFD_LOG_LINE(msg, expression) \ ::nfd::LoggerTimestamp{} << " "#msg": " << "[" << g_logger << "] " << expression #define NFD_LOG(level, msg, expression) \ do { \ if (g_logger.isEnabled(::nfd::LOG_##level)) { \ - BOOST_LOG(g_logger.boostLogger) << NFD_LOG_LINE(msg, expression); \ + NFD_BOOST_LOG(g_logger.boostLogger) << NFD_LOG_LINE(msg, expression); \ } \ } while (false)