Commit ad8220c9 authored by gabime's avatar gabime

fix compile in gcc

parent 74b02687
...@@ -173,7 +173,7 @@ private: ...@@ -173,7 +173,7 @@ private:
// worker thread // worker thread
std::thread _worker_thread; std::thread _worker_thread;
void push_msg(async_msg& new_msg); void push_msg(async_msg&& new_msg);
// throw last worker thread exception or if worker thread is not active // throw last worker thread exception or if worker thread is not active
void throw_if_bad_worker(); void throw_if_bad_worker();
...@@ -232,14 +232,13 @@ inline spdlog::details::async_log_helper::~async_log_helper() ...@@ -232,14 +232,13 @@ inline spdlog::details::async_log_helper::~async_log_helper()
//Try to push and block until succeeded //Try to push and block until succeeded
inline void spdlog::details::async_log_helper::log(const details::log_msg& msg) inline void spdlog::details::async_log_helper::log(const details::log_msg& msg)
{ {
async_msg new_msg(msg); push_msg(async_msg(msg));
push_msg(new_msg);
} }
//Try to push and block until succeeded //Try to push and block until succeeded
inline void spdlog::details::async_log_helper::push_msg(details::async_log_helper::async_msg& new_msg) inline void spdlog::details::async_log_helper::push_msg(details::async_log_helper::async_msg&& new_msg)
{ {
throw_if_bad_worker(); throw_if_bad_worker();
if (!_q.enqueue(std::move(new_msg)) && _overflow_policy != async_overflow_policy::discard_log_msg) if (!_q.enqueue(std::move(new_msg)) && _overflow_policy != async_overflow_policy::discard_log_msg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment