mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Merge PR #672: Unix.c: remove macOS-specific UnixGetTick64() implementation
This commit is contained in:
commit
3f394d23c1
@ -128,8 +128,6 @@
|
||||
#include <Mayaqua/Mayaqua.h>
|
||||
|
||||
#ifdef UNIX_MACOS
|
||||
#include <mach/clock.h>
|
||||
#include <mach/mach.h>
|
||||
#ifdef NO_VLAN
|
||||
// Struct statfs for MacOS X
|
||||
typedef struct fsid { int32_t val[2]; } fsid_t;
|
||||
@ -2092,23 +2090,9 @@ UINT64 UnixGetTick64()
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
#else
|
||||
#ifdef UNIX_MACOS
|
||||
static clock_serv_t clock_serv = 0;
|
||||
mach_timespec_t t;
|
||||
UINT64 ret;
|
||||
if (clock_serv == 0) {
|
||||
host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &clock_serv);
|
||||
}
|
||||
clock_get_time(clock_serv, &t);
|
||||
ret = ((UINT64)((UINT32)t.tv_sec)) * 1000LL + (UINT64)t.tv_nsec / 1000000LL;
|
||||
return ret;
|
||||
#else
|
||||
return TickRealtimeManual();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// Get the system timer
|
||||
|
Loading…
Reference in New Issue
Block a user