1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 01:49:53 +03:00

Unix.c: remove macOS-specific UnixGetTick64() implementation

clock_gettime() was implemented in macOS 10.12.
This commit is contained in:
Davide Beatrici 2018-08-24 06:43:45 +02:00
parent e530932df6
commit 19e837d81e

View File

@ -128,8 +128,6 @@
#include <Mayaqua/Mayaqua.h> #include <Mayaqua/Mayaqua.h>
#ifdef UNIX_MACOS #ifdef UNIX_MACOS
#include <mach/clock.h>
#include <mach/mach.h>
#ifdef NO_VLAN #ifdef NO_VLAN
// Struct statfs for MacOS X // Struct statfs for MacOS X
typedef struct fsid { int32_t val[2]; } fsid_t; typedef struct fsid { int32_t val[2]; } fsid_t;
@ -2092,23 +2090,9 @@ UINT64 UnixGetTick64()
} }
return ret; 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 #else
return TickRealtimeManual(); return TickRealtimeManual();
#endif #endif
#endif
} }
// Get the system timer // Get the system timer