Skip to content

Commit

Permalink
replace use of deprecated function ftime with gettimeofday
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jun 12, 2020
1 parent ab36a05 commit ce7c3a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Base/TimeInfo.cpp
Expand Up @@ -26,6 +26,9 @@
#ifndef _PreComp_
# include <sstream>
# include <QDateTime>
# if defined(FC_OS_LINUX)
# include <sys/time.h>
# endif
#endif

#include "TimeInfo.h"
Expand Down Expand Up @@ -57,15 +60,15 @@ TimeInfo::~TimeInfo()

void TimeInfo::setCurrent(void)
{
#if defined (FC_OS_BSD)
#if defined (FC_OS_BSD) || defined(FC_OS_LINUX)
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);
ftime(&timebuffer); // deprecated
#endif
}

Expand Down

0 comments on commit ce7c3a4

Please sign in to comment.