mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 00:38:52 +00:00
mlog: probable fix for gmtime_r not being available on windows
This commit is contained in:
parent
b01990124e
commit
c3d7a198bf
@ -43,7 +43,12 @@ static std::string generate_log_filename(const char *base)
|
|||||||
char tmp[200];
|
char tmp[200];
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
time_t now = time(NULL);
|
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");
|
strcpy(tmp, "unknown");
|
||||||
else
|
else
|
||||||
strftime(tmp, sizeof(tmp), "%Y-%m-%d-%H-%M-%S", &tm);
|
strftime(tmp, sizeof(tmp), "%Y-%m-%d-%H-%M-%S", &tm);
|
||||||
|
Loading…
Reference in New Issue
Block a user