Merge pull request #4880

96e6b439 blockchain_stats: don't use gmtime_r on Windows (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2018-12-04 17:29:46 +02:00
commit d4a0fb2b89
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
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
}
}