adjust fix for BSD for time info from commit 5f0073b

This commit is contained in:
wmayer 2016-08-12 14:03:16 +02:00
parent 006de1ab19
commit 4790648065
2 changed files with 11 additions and 9 deletions

View File

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

View File

@ -28,10 +28,10 @@
#include <stdio.h>
#if defined(FC_OS_WIN32)
#include <sys/timeb.h>
#else
#if defined(FC_OS_BSD)
#include <sys/time.h>
#else
#include <sys/timeb.h>
#endif
#include <time.h>
@ -39,11 +39,11 @@
# include <stdint.h>
#endif
#if !defined(FC_OS_WIN32)
#if defined(FC_OS_BSD)
struct timeb
{
int64_t time;
unsigned short millitm;
int64_t time;
unsigned short millitm;
};
#endif