From bf4a369360f140957b5ef0218fe4ea48ccb90879 Mon Sep 17 00:00:00 2001 From: morfidon <57798071+morfidon@users.noreply.github.com> Date: Tue, 10 Mar 2026 12:50:16 +0100 Subject: [PATCH] Add SDL_TICKS_PASSED fallback Add SDL_TICKS_PASSED fallback definitions in the shared SDL compatibility headers so SDL1-family targets do not fail when the macro is missing from the platform SDL headers. --- Source/utils/sdl2_to_1_2_backports.h | 1 + Source/utils/sdl_compat.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Source/utils/sdl2_to_1_2_backports.h b/Source/utils/sdl2_to_1_2_backports.h index 2a18cca66..5e13df332 100644 --- a/Source/utils/sdl2_to_1_2_backports.h +++ b/Source/utils/sdl2_to_1_2_backports.h @@ -26,6 +26,7 @@ #define SDL_floor floor #define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) +#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) //== Events handling diff --git a/Source/utils/sdl_compat.h b/Source/utils/sdl_compat.h index 898a151e5..56690864c 100644 --- a/Source/utils/sdl_compat.h +++ b/Source/utils/sdl_compat.h @@ -19,6 +19,10 @@ #endif #endif +#ifndef SDL_TICKS_PASSED +#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) +#endif + #ifdef USE_SDL1 #define SDL_Scancode Uint8 #endif