From 227c33b8ecec3afb93ecac26cd8c954e9598f37f Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 13 Oct 2021 09:33:57 -0700
Subject: [PATCH] Add note about SDL_TICKS_PASSED hitting int overflow problems
with large timeouts
---
include/SDL_timer.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/SDL_timer.h b/include/SDL_timer.h
index 04696dc887..b23686bc3e 100644
--- a/include/SDL_timer.h
+++ b/include/SDL_timer.h
@@ -60,6 +60,10 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
* // ... do work until timeout has elapsed
* }
* ```
+ *
+ * Note that this does not handle tick differences greater
+ * than 2^31 so take care when using the above kind of code
+ * with large timeout delays (tens of days).
*/
#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)