Avoid using gettimeofday.
This commit is contained in:
parent
84e9eb65af
commit
b741905cf1
|
@ -31,11 +31,6 @@
|
||||||
# include <sys/mman.h>
|
# include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
|
||||||
# include <sys/time.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "wine/winbase16.h"
|
#include "wine/winbase16.h"
|
||||||
|
@ -193,19 +188,17 @@ static BIOSDATA * DOSMEM_BiosData(void)
|
||||||
*/
|
*/
|
||||||
static DWORD DOSMEM_GetTicksSinceMidnight(void)
|
static DWORD DOSMEM_GetTicksSinceMidnight(void)
|
||||||
{
|
{
|
||||||
struct tm *bdtime;
|
SYSTEMTIME time;
|
||||||
struct timeval tvs;
|
|
||||||
time_t seconds;
|
|
||||||
|
|
||||||
/* This should give us the (approximately) correct
|
/* This should give us the (approximately) correct
|
||||||
* 18.206 clock ticks per second since midnight.
|
* 18.206 clock ticks per second since midnight.
|
||||||
*/
|
*/
|
||||||
gettimeofday( &tvs, NULL );
|
|
||||||
seconds = tvs.tv_sec;
|
GetLocalTime( &time );
|
||||||
bdtime = localtime( &seconds );
|
|
||||||
return (((bdtime->tm_hour * 3600 + bdtime->tm_min * 60 +
|
return (((time.wHour * 3600 + time.wMinute * 60 +
|
||||||
bdtime->tm_sec) * 18206) / 1000) +
|
time.wSecond) * 18206) / 1000) +
|
||||||
(tvs.tv_usec / 54927);
|
(time.wMilliseconds * 1000 / 54927);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
Loading…
Reference in New Issue