Files
jami-daemon/MSVC/sys_time.h
atraczyk 294db6bc90 build: add windows UWP project specific header files
- adds header files that are needed to build the daemon for UWP
  natively in Windows

Change-Id: I5696f1fa0b6761701fdcae3ef0fe0366e1f13ab0
Tuleap: #790
2016-12-12 12:35:09 -05:00

41 lines
943 B
C

#ifndef SYS_TIME_H_
#define SYS_TIME_H_
#include <time.h>
#include <winsock2.h>
struct timezone
{
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};
static __inline int gettimeofday(struct timeval *tp, struct timezone * tzp)
{
FILETIME file_time;
SYSTEMTIME system_time;
ULARGE_INTEGER ularge;
static int tzflag;
GetSystemTime(&system_time);
SystemTimeToFileTime(&system_time, &file_time);
ularge.LowPart = file_time.dwLowDateTime;
ularge.HighPart = file_time.dwHighDateTime;
tp->tv_sec = (long)((ularge.QuadPart - 116444736000000000Ui64) / 10000000L);
tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
if (NULL != tzp)
{
if (!tzflag)
{
_tzset();
tzflag++;
}
tzp->tz_minuteswest = _timezone / 60;
tzp->tz_dsttime = _daylight;
}
return 0;
}
#endif