From 413c8988428a181ea93eb38ed68965433d0af5c8 Mon Sep 17 00:00:00 2001 From: Lilis Iskandar Date: Sat, 9 Dec 2023 11:13:52 +0800 Subject: [PATCH] sdl/timer: add stub function for SDL_GetTicks64() when running on SDL2 version older than 2.0.18 Signed-off-by: Lilis Iskandar --- sdl/timer.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sdl/timer.go b/sdl/timer.go index a653d966..ab33ef6c 100644 --- a/sdl/timer.go +++ b/sdl/timer.go @@ -1,6 +1,21 @@ package sdl -// #include "sdl_wrapper.h" +/* +#include "sdl_wrapper.h" + +#if !(SDL_VERSION_ATLEAST(2,0,18)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_GetTicks64 is not supported before SDL 2.0.18") +#endif + +static inline Uint64 SDL_GetTicks64(void) +{ + return 0; +} + +#endif +*/ import "C" // GetTicks returns the number of milliseconds since the SDL library initialization.