blockchain_stats: don't use gmtime_r on Windows

In some cases, it doesn't like it (I don't know the details).

Factor into a new epee function
This commit is contained in:
moneromooo-monero 2018-11-20 22:26:50 +00:00
parent 84dd674cd0
commit 96e6b43970
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
4 changed files with 13 additions and 12 deletions

View file

@ -122,6 +122,15 @@ namespace misc_utils
return boost::lexical_cast<std::string>(GetCurrentThreadId());
#elif defined(__GNUC__)
return boost::lexical_cast<std::string>(pthread_self());
#endif
}
inline bool get_gmt_time(time_t t, struct tm &tm)
{
#ifdef _WIN32
return gmtime_s(&tm, &t);
#else
return gmtime_r(&t, &tm);
#endif
}
}