features_cpu: synchronize ifdefs for CLOCK_MONOTONIC
The ifdef in cpu_features_get_time_usec was more portable than the one in cpu_features_get_perf_counter. Make them the same to avoid 'undefined reference to __mftb' on FreeBSD/powerpc64.
This commit is contained in:
parent
2004545f96
commit
f9ae48c3f6
|
@ -171,7 +171,7 @@ retro_perf_tick_t cpu_features_get_perf_counter(void)
|
||||||
tv_sec = (long)((ularge.QuadPart - epoch) / 10000000L);
|
tv_sec = (long)((ularge.QuadPart - epoch) / 10000000L);
|
||||||
tv_usec = (long)(system_time.wMilliseconds * 1000);
|
tv_usec = (long)(system_time.wMilliseconds * 1000);
|
||||||
time_ticks = (1000000 * tv_sec + tv_usec);
|
time_ticks = (1000000 * tv_sec + tv_usec);
|
||||||
#elif defined(__linux__) || defined(__QNX__) || defined(__MACH__)
|
#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(__QNX__) || defined(ANDROID) || defined(__MACH__) || defined(__PSL1GHT__)
|
||||||
struct timespec tv = {0};
|
struct timespec tv = {0};
|
||||||
if (ra_clock_gettime(CLOCK_MONOTONIC, &tv) == 0)
|
if (ra_clock_gettime(CLOCK_MONOTONIC, &tv) == 0)
|
||||||
time_ticks = (retro_perf_tick_t)tv.tv_sec * 1000000000 +
|
time_ticks = (retro_perf_tick_t)tv.tv_sec * 1000000000 +
|
||||||
|
|
Loading…
Reference in New Issue