From 2fad85fa264e31570764fdb5bcb36632d7fa3da7 Mon Sep 17 00:00:00 2001
From: rabbit-ecl <[EMAIL REDACTED]>
Date: Thu, 26 Feb 2026 03:14:01 +0200
Subject: [PATCH] Use Uint64 instead for tick_numerators in USE_128BIT_MATH
(cherry picked from commit 230814e85e9c69beeb876259b4a2bdc5ed377f9a)
---
src/timer/SDL_timer.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/timer/SDL_timer.c b/src/timer/SDL_timer.c
index 9bd3da408f140..5fc4573d3a309 100644
--- a/src/timer/SDL_timer.c
+++ b/src/timer/SDL_timer.c
@@ -541,8 +541,8 @@ typedef unsigned __int128 Uint128;
static Uint64 tick_start;
#ifdef USE_128BIT_MATH
-static Uint128 tick_numerator_ns;
-static Uint128 tick_numerator_ms;
+static Uint64 tick_numerator_ns;
+static Uint64 tick_numerator_ms;
#else
static Uint32 tick_numerator_ns;
static Uint32 tick_denominator_ns;
@@ -609,8 +609,8 @@ void SDL_InitTicks(void)
SDL_assert(tick_freq > 0 && tick_freq <= (Uint64)SDL_MAX_UINT32);
#ifdef USE_128BIT_MATH
- tick_numerator_ns = ((Uint128)SDL_NS_PER_SECOND << 32) / tick_freq;
- tick_numerator_ms = ((Uint128)SDL_MS_PER_SECOND << 32) / tick_freq;
+ tick_numerator_ns = ((Uint64)SDL_NS_PER_SECOND << 32) / tick_freq;
+ tick_numerator_ms = ((Uint64)SDL_MS_PER_SECOND << 32) / tick_freq;
#else
gcd = SDL_CalculateGCD(SDL_NS_PER_SECOND, (Uint32)tick_freq);
tick_numerator_ns = (SDL_NS_PER_SECOND / gcd);