Fixes #282 : compilation error in MSVC
This commit is contained in:
parent
fa38408853
commit
da7eee64a8
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue