From 6bad2daa623f95fe5a675cd6583285db44256ae4 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 6 May 2015 19:18:00 -0400 Subject: [PATCH] fixed build errors for gcc 4.6 --- Log.cpp | 4 ++++ Log.h | 6 +++++- NetDb.h | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Log.cpp b/Log.cpp index 2fccb7d6..2507258e 100644 --- a/Log.cpp +++ b/Log.cpp @@ -24,7 +24,11 @@ void LogMsg::Process() const std::string& Log::GetTimestamp () { +#if (__GNUC__ == 4) && (__GNUC_MINOR__ <= 6) + auto ts = std::chrono::monotonic_clock::now (); +#else auto ts = std::chrono::steady_clock::now (); +#endif if (ts > m_LastTimestampUpdate + std::chrono::milliseconds (500)) // 0.5 second { m_LastTimestampUpdate = ts; diff --git a/Log.h b/Log.h index 103b84ac..5fda7b21 100644 --- a/Log.h +++ b/Log.h @@ -50,7 +50,11 @@ class Log: public i2p::util::MsgQueue std::ostream * m_LogStream; std::string m_Timestamp; - std::chrono::steady_clock::time_point m_LastTimestampUpdate; +#if (__GNUC__ == 4) && (__GNUC_MINOR__ <= 6) // gcc 4.6 + std::chrono::monotonic_clock::time_point m_LastTimestampUpdate; +#else + std::chrono::steady_clock::time_point m_LastTimestampUpdate; +#endif }; extern Log * g_Log; diff --git a/NetDb.h b/NetDb.h index 44efa454..1de70000 100644 --- a/NetDb.h +++ b/NetDb.h @@ -92,7 +92,7 @@ namespace data Reseeder * m_Reseeder; - friend NetDbRequests; + friend class NetDbRequests; NetDbRequests m_Requests; static const char m_NetDbPath[];