[DEBUG] correct build
This commit is contained in:
parent
53e8ce8afb
commit
dd2a36e9a8
@ -1,4 +1,4 @@
|
|||||||
/** @file
|
o/** @file
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @copyright 2016, Edouard DUPIN, all right reserved
|
* @copyright 2016, Edouard DUPIN, all right reserved
|
||||||
* @license MPL v2.0 (see license file)
|
* @license MPL v2.0 (see license file)
|
||||||
|
@ -18,7 +18,9 @@ static int64_t getTime() {
|
|||||||
return int64_t(now.tv_sec)*1000000LL + int64_t(now.tv_usec);
|
return int64_t(now.tv_sec)*1000000LL + int64_t(now.tv_usec);
|
||||||
#elif defined(__TARGET_OS__Web) \
|
#elif defined(__TARGET_OS__Web) \
|
||||||
|| defined(__TARGET_OS__Linux) \
|
|| defined(__TARGET_OS__Linux) \
|
||||||
|| defined(__TARGET_OS__buildroot)
|
|| defined(__TARGET_OS__buildroot) \
|
||||||
|
|| defined(__TARGET_OS__MacOs) \
|
||||||
|
|| defined(__TARGET_OS__IOs)
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
#ifdef CLOCK_BOOTTIME
|
#ifdef CLOCK_BOOTTIME
|
||||||
int ret = clock_gettime(CLOCK_BOOTTIME, &now);
|
int ret = clock_gettime(CLOCK_BOOTTIME, &now);
|
||||||
@ -31,17 +33,6 @@ static int64_t getTime() {
|
|||||||
now.tv_nsec = 0;
|
now.tv_nsec = 0;
|
||||||
}
|
}
|
||||||
return int64_t(now.tv_sec)*1000000LL + int64_t(now.tv_nsec)/1000LL;
|
return int64_t(now.tv_sec)*1000000LL + int64_t(now.tv_nsec)/1000LL;
|
||||||
#elif defined(__TARGET_OS__MacOs) \
|
|
||||||
|| defined(__TARGET_OS__IOs)
|
|
||||||
struct timespec now;
|
|
||||||
clock_serv_t cclock;
|
|
||||||
mach_timespec_t mts;
|
|
||||||
host_get_clock_service(mach_host_self(), REALTIME_CLOCK, &cclock);
|
|
||||||
clock_get_time(cclock, &mts);
|
|
||||||
mach_port_deallocate(mach_task_self(), cclock);
|
|
||||||
now.tv_sec = mts.tv_sec;
|
|
||||||
now.tv_nsec = mts.tv_nsec;
|
|
||||||
return int64_t(now.tv_sec)*1000000LL + int64_t(now.tv_nsec)/1000LL;
|
|
||||||
#else
|
#else
|
||||||
#error must be implemented ...
|
#error must be implemented ...
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,7 +18,9 @@ static int64_t getTime() {
|
|||||||
return int64_t(now.tv_sec)*1000000LL + int64_t(now.tv_usec);
|
return int64_t(now.tv_sec)*1000000LL + int64_t(now.tv_usec);
|
||||||
#elif defined(__TARGET_OS__Web) \
|
#elif defined(__TARGET_OS__Web) \
|
||||||
|| defined(__TARGET_OS__Linux) \
|
|| defined(__TARGET_OS__Linux) \
|
||||||
|| defined(__TARGET_OS__buildroot)
|
|| defined(__TARGET_OS__buildroot) \
|
||||||
|
|| defined(__TARGET_OS__MacOs) \
|
||||||
|
|| defined(__TARGET_OS__IOs)
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
int ret = clock_gettime(CLOCK_REALTIME, &now);
|
int ret = clock_gettime(CLOCK_REALTIME, &now);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
@ -27,17 +29,6 @@ static int64_t getTime() {
|
|||||||
now.tv_nsec = 0;
|
now.tv_nsec = 0;
|
||||||
}
|
}
|
||||||
return int64_t(now.tv_sec)*1000000LL + int64_t(now.tv_nsec)/1000LL;
|
return int64_t(now.tv_sec)*1000000LL + int64_t(now.tv_nsec)/1000LL;
|
||||||
#elif defined(__TARGET_OS__MacOs) \
|
|
||||||
|| defined(__TARGET_OS__IOs)
|
|
||||||
struct timespec now;
|
|
||||||
clock_serv_t cclock;
|
|
||||||
mach_timespec_t mts;
|
|
||||||
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
|
|
||||||
clock_get_time(cclock, &mts);
|
|
||||||
mach_port_deallocate(mach_task_self(), cclock);
|
|
||||||
now.tv_sec = mts.tv_sec;
|
|
||||||
now.tv_nsec = mts.tv_nsec;
|
|
||||||
return int64_t(now.tv_sec)*1000000LL + int64_t(now.tv_nsec)/1000LL;
|
|
||||||
#else
|
#else
|
||||||
#error must be implemented ...
|
#error must be implemented ...
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user