[Utils] Use gmtime_s with _WIN32
This allows the project to build in WSL/Ubuntu 20.04 x64
and potentially other Windows versions.
MODIFY
src/utiltime.cpp
src/utiltime.cpp
@@ -79,7 +79,7 @@ void MilliSleep(int64_t n)
std::string FormatISO8601DateTime(int64_t nTime) {
struct tm ts;
time_t time_val = nTime;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(_WIN32)
gmtime_s(&ts, &time_val);
#else
gmtime_r(&time_val, &ts);
@@ -90,7 +90,7 @@ std::string FormatISO8601DateTime(int64_t nTime) {
std::string FormatISO8601Date(int64_t nTime) {
struct tm ts;
time_t time_val = nTime;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(_WIN32)
gmtime_s(&ts, &time_val);
#else
gmtime_r(&time_val, &ts);
@@ -101,7 +101,7 @@ std::string FormatISO8601Date(int64_t nTime) {
std::string FormatISO8601Time(int64_t nTime) {
struct tm ts;
time_t time_val = nTime;
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(_WIN32)
gmtime_s(&ts, &time_val);
#else
gmtime_r(&time_val, &ts);

[Utils] Use gmtime_s with _WIN32

This allows the project to build in WSL/Ubuntu 20.04 x64
and potentially other Windows versions.