Skip to content

Commit

Permalink
adjust fix for BSD for time info from commit 5f0073b
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Aug 12, 2016
1 parent 006de1a commit 4790648
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions src/Base/TimeInfo.cpp
Expand Up @@ -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
}

Expand Down
12 changes: 6 additions & 6 deletions src/Base/TimeInfo.h
Expand Up @@ -28,22 +28,22 @@


#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>

#ifdef __GNUC__
# 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

Expand Down

0 comments on commit 4790648

Please sign in to comment.