diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-12-04 17:29:46 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-12-04 17:29:46 +0200 |
commit | d4a0fb2b895f073c0852bdd42cd05ef4eeb21e3c (patch) | |
tree | 71f245b66e10da5d95b48925bdadbcde5d7e3493 /contrib/epee/include | |
parent | Merge pull request #4878 (diff) | |
parent | blockchain_stats: don't use gmtime_r on Windows (diff) | |
download | monero-d4a0fb2b895f073c0852bdd42cd05ef4eeb21e3c.tar.xz |
Merge pull request #4880
96e6b439 blockchain_stats: don't use gmtime_r on Windows (moneromooo-monero)
Diffstat (limited to 'contrib/epee/include')
-rw-r--r-- | contrib/epee/include/misc_os_dependent.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/epee/include/misc_os_dependent.h b/contrib/epee/include/misc_os_dependent.h index 0d09683d6..5fffde8d5 100644 --- a/contrib/epee/include/misc_os_dependent.h +++ b/contrib/epee/include/misc_os_dependent.h @@ -124,5 +124,14 @@ namespace misc_utils 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 + } } } |