replace use of deprecated function ftime with gettimeofday

This commit is contained in:
wmayer
2020-06-12 01:27:32 +02:00
committed by wwmayer
parent 8b5e05d1dc
commit 29fb43110b

View File

@@ -26,6 +26,9 @@
#ifndef _PreComp_
# include <sstream>
# include <QDateTime>
# if defined(FC_OS_LINUX)
# include <sys/time.h>
# endif
#endif
#include "TimeInfo.h"
@@ -57,7 +60,7 @@ 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;
@@ -65,7 +68,7 @@ void TimeInfo::setCurrent(void)
#elif defined(FC_OS_WIN32)
_ftime(&timebuffer);
#else
ftime(&timebuffer);
ftime(&timebuffer); // deprecated
#endif
}