From 4790648065190df1ea3a415e3293d0a05a4550ad Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 12 Aug 2016 14:03:16 +0200 Subject: [PATCH] adjust fix for BSD for time info from commit 5f0073b --- src/Base/TimeInfo.cpp | 8 +++++--- src/Base/TimeInfo.h | 12 ++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Base/TimeInfo.cpp b/src/Base/TimeInfo.cpp index 99e707aa8011..7d1a669bef2c 100644 --- a/src/Base/TimeInfo.cpp +++ b/src/Base/TimeInfo.cpp @@ -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 } diff --git a/src/Base/TimeInfo.h b/src/Base/TimeInfo.h index bdb75f9f77ae..2ad7a481c9e3 100644 --- a/src/Base/TimeInfo.h +++ b/src/Base/TimeInfo.h @@ -28,10 +28,10 @@ #include -#if defined(FC_OS_WIN32) -#include -#else +#if defined(FC_OS_BSD) #include +#else +#include #endif #include @@ -39,11 +39,11 @@ # include #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