diff --git a/Platform.h b/Platform.h index 0f190f54..eced588b 100644 --- a/Platform.h +++ b/Platform.h @@ -25,11 +25,12 @@ void SetAffinity ( int cpu ); // That's not UINT64_MAX as it's converted to int64_t sometimes. constexpr uint64_t timer_inf = INT64_MAX; -__inline__ uint64_t timer_sub(uint64_t a, uint64_t b) +static inline uint64_t timer_sub(uint64_t a, uint64_t b) { #if defined(__mips__) // Tune SafeMHzFor32CC to reflect max clock freq. of your machine with 32-bit cycle counter. const uint32_t SafeMHzFor32CC = 1500; + if ((a >> 60) != (b >> 60)) return timer_inf; const uint32_t scale = (a >> 60) + 1; const uint32_t acc = a & UINT32_MAX, bcc = b & UINT32_MAX;