freeswitch/libs/libnatpmp/wingettimeofday.c
Michael Jerris f52df34b37 add pnp libs
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13510 d0543943-73ff-0310-b7d9-9358b9ac24b2
2009-05-29 20:14:45 +00:00

26 lines
609 B
C

#ifdef WIN32
#include <sys/time.h>
typedef struct _FILETIME {
unsigned long dwLowDateTime;
unsigned long dwHighDateTime;
} FILETIME;
void __stdcall GetSystemTimeAsFileTime(FILETIME*);
//void gettimeofday(struct timeval* p, void* tz /* IGNORED */);
void gettimeofday(struct timeval* p, void* tz /* IGNORED */) {
union {
long long ns100; /*time since 1 Jan 1601 in 100ns units */
FILETIME ft;
} _now;
GetSystemTimeAsFileTime( &(_now.ft) );
p->tv_usec=(long)((_now.ns100 / 10LL) % 1000000LL );
p->tv_sec= (long)((_now.ns100-(116444736000000000LL))/10000000LL);
return;
}
#endif