Browse Source

fixed build errors for gcc 4.6

pull/189/head
orignal 10 years ago
parent
commit
6bad2daa62
  1. 4
      Log.cpp
  2. 4
      Log.h
  3. 2
      NetDb.h

4
Log.cpp

@ -24,7 +24,11 @@ void LogMsg::Process()
const std::string& Log::GetTimestamp () 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 (); auto ts = std::chrono::steady_clock::now ();
#endif
if (ts > m_LastTimestampUpdate + std::chrono::milliseconds (500)) // 0.5 second if (ts > m_LastTimestampUpdate + std::chrono::milliseconds (500)) // 0.5 second
{ {
m_LastTimestampUpdate = ts; m_LastTimestampUpdate = ts;

4
Log.h

@ -50,7 +50,11 @@ class Log: public i2p::util::MsgQueue<LogMsg>
std::ostream * m_LogStream; std::ostream * m_LogStream;
std::string m_Timestamp; std::string m_Timestamp;
#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; std::chrono::steady_clock::time_point m_LastTimestampUpdate;
#endif
}; };
extern Log * g_Log; extern Log * g_Log;

2
NetDb.h

@ -92,7 +92,7 @@ namespace data
Reseeder * m_Reseeder; Reseeder * m_Reseeder;
friend NetDbRequests; friend class NetDbRequests;
NetDbRequests m_Requests; NetDbRequests m_Requests;
static const char m_NetDbPath[]; static const char m_NetDbPath[];

Loading…
Cancel
Save