diff options
| author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-02-04 11:47:41 +0000 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-02-04 11:48:58 +0000 |
| commit | c3d7a198bff47a249202bde5bcb79c5daad6951e (patch) | |
| tree | 2428ee0c94b07b85ba52195f5af496d8a7e3856e /contrib/epee/src/mlog.cpp | |
| parent | b01990124ea6415114deca35789418b50300e07c (diff) | |
| download | monzero-core-c3d7a198bff47a249202bde5bcb79c5daad6951e.tar.gz monzero-core-c3d7a198bff47a249202bde5bcb79c5daad6951e.tar.xz monzero-core-c3d7a198bff47a249202bde5bcb79c5daad6951e.zip | |
mlog: probable fix for gmtime_r not being available on windows
Diffstat (limited to 'contrib/epee/src/mlog.cpp')
| -rw-r--r-- | contrib/epee/src/mlog.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/epee/src/mlog.cpp b/contrib/epee/src/mlog.cpp index 139e7b7d6..4eadd2ffd 100644 --- a/contrib/epee/src/mlog.cpp +++ b/contrib/epee/src/mlog.cpp @@ -43,7 +43,12 @@ static std::string generate_log_filename(const char *base) char tmp[200]; struct tm tm; time_t now = time(NULL); - if (!gmtime_r(&now, &tm)) + if +#ifdef WIN32 + (!gmtime_s(&tm, &now)) +#else + (!gmtime_r(&now, &tm)) +#endif strcpy(tmp, "unknown"); else strftime(tmp, sizeof(tmp), "%Y-%m-%d-%H-%M-%S", &tm); |
