|
@@ -199,7 +199,7 @@ static _stm_state_t _stm;
|
|
|
see https://gist.github.com/jspohr/3dc4f00033d79ec5bdaf67bc46c813e3
|
|
|
*/
|
|
|
#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__))
|
|
|
-_SOKOL_PRIVATE int64_t int64_muldiv(int64_t value, int64_t numer, int64_t denom) {
|
|
|
+_SOKOL_PRIVATE int64_t _stm_int64_muldiv(int64_t value, int64_t numer, int64_t denom) {
|
|
|
int64_t q = value / denom;
|
|
|
int64_t r = value % denom;
|
|
|
return q * numer + r * numer / denom;
|
|
@@ -230,10 +230,10 @@ SOKOL_API_IMPL uint64_t stm_now(void) {
|
|
|
#if defined(_WIN32)
|
|
|
LARGE_INTEGER qpc_t;
|
|
|
QueryPerformanceCounter(&qpc_t);
|
|
|
- now = (uint64_t) int64_muldiv(qpc_t.QuadPart - _stm.start.QuadPart, 1000000000, _stm.freq.QuadPart);
|
|
|
+ now = (uint64_t) _stm_int64_muldiv(qpc_t.QuadPart - _stm.start.QuadPart, 1000000000, _stm.freq.QuadPart);
|
|
|
#elif defined(__APPLE__) && defined(__MACH__)
|
|
|
const uint64_t mach_now = mach_absolute_time() - _stm.start;
|
|
|
- now = (uint64_t) int64_muldiv((int64_t)mach_now, (int64_t)_stm.timebase.numer, (int64_t)_stm.timebase.denom);
|
|
|
+ now = (uint64_t) _stm_int64_muldiv((int64_t)mach_now, (int64_t)_stm.timebase.numer, (int64_t)_stm.timebase.denom);
|
|
|
#elif defined(__EMSCRIPTEN__)
|
|
|
double js_now = emscripten_get_now() - _stm.start;
|
|
|
now = (uint64_t) (js_now * 1000000.0);
|