fix compilation with mingw32

This commit is contained in:
Andrzej Rybczak
2010-05-14 18:05:14 +02:00
parent 6eae6cd0f6
commit 9adb762036
2 changed files with 8 additions and 0 deletions

View File

@@ -268,8 +268,12 @@ bool CaseInsensitiveSorting::operator()(const MPD::Item &a, const MPD::Item &b)
std::string Timestamp(time_t t)
{
char result[32];
# ifdef WIN32
result[strftime(result, 31, "%x %X", localtime(&t))] = 0;
# else
tm info;
result[strftime(result, 31, "%x %X", localtime_r(&t, &info))] = 0;
# endif // WIN32
return result;
}