mingw portability fixes

This commit is contained in:
Charles Kerr
2008-01-10 18:52:46 +00:00
parent d40a341c76
commit 3a6396a3cb
9 changed files with 18 additions and 8 deletions

View File

@@ -94,7 +94,12 @@ tr_getLogTimeStr( char * buf, int buflen )
now = time( NULL );
gettimeofday( &tv, NULL );
#ifdef WIN32
now_tm = *localtime( &now );
#else
localtime_r( &now, &now_tm );
#endif
strftime( tmp, sizeof(tmp), "%H:%M:%S", &now_tm );
milliseconds = (int)(tv.tv_usec / 1000);
snprintf( buf, buflen, "%s.%03d", tmp, milliseconds );