mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Fix a FIXME about the format and add a test.
While at it, use strftime on Unix too and use the thread safe versions of localtime. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186090 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -31,20 +31,15 @@ TimeValue TimeValue::now() {
|
||||
}
|
||||
|
||||
std::string TimeValue::str() const {
|
||||
#ifdef __MINGW32__
|
||||
// This ban may be lifted by either:
|
||||
// (i) a future MinGW version other than 1.0 inherents the __time64_t type, or
|
||||
// (ii) configure tests for either the time_t or __time64_t type.
|
||||
time_t ourTime = time_t(this->toEpochTime());
|
||||
struct tm *lt = ::localtime(&ourTime);
|
||||
#else
|
||||
__time64_t ourTime = this->toEpochTime();
|
||||
struct tm *lt = ::_localtime64(&ourTime);
|
||||
#endif
|
||||
struct tm LT;
|
||||
__time64_t OurTime = this->toEpochTime();
|
||||
errno_t Error = ::_localtime64_s(<, &OurTime);
|
||||
assert(!Error);
|
||||
|
||||
char buffer[25];
|
||||
strftime(buffer, 25, "%a %b %d %H:%M:%S %Y", lt);
|
||||
return std::string(buffer);
|
||||
char Buffer[25];
|
||||
// FIXME: the windows version of strftime doesn't support %e
|
||||
strftime(Buffer, 25, "%b %d %H:%M %Y", <);
|
||||
return std::string(Buffer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user