0203 SIP gettimeofday 编译
gettimeofday 是个LINUX函数
微软官方的:
void gettimeofday(struct timeval *now, struct timezone *zone)
&leftsign;
UnusedParameter(zone);
Etotv(CurrentTime(),now);
&rightsign;
void Etotv(TIME e, struct timeval *tv)
&leftsign;
INT64 t;
tv->tv_sec = Int64ToInt32(Int64DividedByInt32(e, 10000000));
Int32ToInt64(t, tv->tv_sec);
t = Int64TimesInt32(t, 10000000);
t = Int64Subtract(e, t);
t = Int64DividedByInt32(t, 10);
tv->tv_usec = Int64ToInt32(t);
&rightsign;
/*
* Entry point for Int64DividedByInt32
*/
_FUNCTION(Int64DividedByInt32)
stmdb sp!,&leftsign;r4-r8,lr&rightsign; /* save registers on stack */
mov r4,r3, asr #31 /* extend y (arg2) sign bits */
b DivCommon /* jump to common divide routine */
这是人家的~~~~~
#include "config.h"
#include "wine/port.h"
#ifndef HAVE_GETTIMEOFDAY
__inline int gettimeofday(struct timeval *tv, struct timezone *tz)
#ifdef _WINDOWS
&leftsign;
FILETIME ft;
LARGE_INTEGER li;
__int64 t;
static int tzflag;
if (tv)
&leftsign;
GetSystemTimeAsFileTime(&ft);
li.LowPart = ft.dwLowDateTime;
li.HighPart = ft.dwHighDateTime;
t = li.QuadPart; /* In 100-nanosecond intervals */
t -= EPOCHFILETIME; /* Offset to the Epoch time */
t /= 10; /* In microseconds */
tv->tv_sec = (long)(t / 1000000);
tv->tv_usec = (long)(t % 1000000);
&rightsign;
if (tz)
&leftsign;
if (!tzflag)
&leftsign;
_tzset();
tzflag++;
&rightsign;
tz->tz_minuteswest = _timezone / 60;
tz->tz_dsttime = _daylight;
&rightsign;
return 0;
#else /* !defined(_WINDOWS) */
errno = ENOSYS;
return -1;
#endif /* _WINDOWS */
#endif /* HAVE_GETTIMEOFDAY */
&rightsign;
历史博文
- 20080812 c# wpf scroll text - 2009
- 20070712 搜索引擎 蜘蛛 捕捉 BLOG - 2008
- 1027 vfw 枚举 编码解码器 CODEC DECODEC - 2007
- 面向对象设计模式疑惑 - 2005
- MPICH并行程序+Minidoochun - 2005
- redhat 8.0 linux技巧集萃 - 2005
- MessageQueue编程 - 2005
- EventLog编程 - 2005