BSD Porting fixes, conditional compilation and use of gettimeofday()

This commit is contained in:
David Pello
2016-05-14 20:30:19 +02:00
committed by wmayer
parent b5dfc41759
commit 5f0073b9e0
8 changed files with 43 additions and 9 deletions

View File

@@ -57,10 +57,13 @@ TimeInfo::~TimeInfo()
void TimeInfo::setCurrent(void)
{
#if defined (_MSC_VER)
#if defined (FC_OS_WIN32)
_ftime( &timebuffer );
#elif defined(__GNUC__)
ftime( &timebuffer );
#else
struct timeval t;
gettimeofday(&t, NULL);
timebuffer.time = t.tv_sec;
timebuffer.millitm = t.tv_usec / 1000;
#endif
}