Replaced all ACE_OS::localtime_r calls

This commit is contained in:
leak
2014-06-22 15:42:46 +02:00
parent ccf3374e49
commit 7dd6f0f1d8
10 changed files with 27 additions and 24 deletions

View File

@@ -139,15 +139,14 @@ void stripLineInvisibleChars(std::string &str)
}
std::tm localtime_r(const time_t& time)
struct tm* localtime_r(const time_t* time, struct tm *result)
{
std::tm tm_snapshot;
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
localtime_s(&tm_snapshot, &time);
localtime_s(result, time);
return result;
#else
localtime_r(&time, &tm_snapshot); // POSIX
return localtime_r(&time, &result); // POSIX
#endif
return tm_snapshot;
}
@@ -239,7 +238,8 @@ uint32 TimeStringToSecs(const std::string& timestring)
std::string TimeToTimestampStr(time_t t)
{
tm aTm = localtime_r(t);
tm aTm;
localtime_r(&t, &aTm);
// YYYY year
// MM month (2 digits 01-12)
// DD day (2 digits 01-31)