aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/misc_os_dependent.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-20 22:26:50 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-21 00:50:53 +0000
commit96e6b439705cff5806974bb34e4b46db40dd3dbd (patch)
tree20fe64f9b065f41dfe904be19249bf5cc33a86ee /contrib/epee/include/misc_os_dependent.h
parentMerge pull request #4781 (diff)
downloadmonero-96e6b439705cff5806974bb34e4b46db40dd3dbd.tar.xz
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
Diffstat (limited to '')
-rw-r--r--contrib/epee/include/misc_os_dependent.h9
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
+ }
}
}