Fixes #282 : compilation error in MSVC

This commit is contained in:
eidheim 2019-09-16 09:50:59 +02:00
commit da7eee64a8

View file

@ -339,12 +339,14 @@ namespace SimpleWeb {
auto time = std::chrono::system_clock::to_time_t(time_point);
tm tm;
#ifdef _MSC_VER
auto gmtime = gmtime_s(&time, &tm);
if(gmtime_s(&tm, &time) != 0)
return {};
auto gmtime = &tm;
#else
auto gmtime = gmtime_r(&time, &tm);
#endif
if(!gmtime)
return {};
#endif
switch(gmtime->tm_wday) {
case 0: result += "Sun, "; break;