Refactor to work on Linux / Unix, fix some compiler errors.

CMakeLists was also modified to make this work, but its scuffed
and i will hold on to that for a while longer
This commit is contained in:
Lion Kortlepel
2020-11-01 02:00:27 +01:00
parent 02fbe72eed
commit 8bc35fb82e
18 changed files with 254 additions and 41 deletions

View File

@@ -19,7 +19,11 @@ std::string getDate() {
auto s = std::chrono::duration_cast<std::chrono::seconds>(tp);tp -= s;
time_t tt = std::chrono::system_clock::to_time_t(now);
tm local_tm{};
#ifdef __WIN32
localtime_s(&local_tm,&tt);
#else // unix
localtime_r(&tt, &local_tm);
#endif // __WIN32
std::stringstream date;
int S = local_tm.tm_sec;
int M = local_tm.tm_min;