fixed 'localtime_*' compilation error MinGW
This commit is contained in:
@@ -40,7 +40,9 @@ namespace lib {
|
||||
/// Thread safe cross platform localtime
|
||||
inline std::tm localtime(std::time_t const & time) {
|
||||
std::tm tm_snapshot;
|
||||
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
|
||||
#if (defined(__MINGW32__) || defined(__MINGW64__))
|
||||
memcpy(&tm_snapshot, ::localtime(&time), sizeof(std::tm));
|
||||
#elif (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
|
||||
localtime_s(&tm_snapshot, &time);
|
||||
#else
|
||||
localtime_r(&time, &tm_snapshot); // POSIX
|
||||
|
||||
Reference in New Issue
Block a user