SDL: time: Fix UWP build

From a00ac61514a35548aa80a655e1cfbd2e96ff135f Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Mon, 1 Apr 2024 10:52:24 -0400
Subject: [PATCH] time: Fix UWP build

---
 src/time/windows/SDL_systime.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/time/windows/SDL_systime.c b/src/time/windows/SDL_systime.c
index 7c0d7ef38a101..54a8a3c9b5832 100644
--- a/src/time/windows/SDL_systime.c
+++ b/src/time/windows/SDL_systime.c
@@ -79,14 +79,20 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DATE_FORMAT *df, SDL_TIME_FORMAT *tf
 
 int SDL_GetCurrentTime(SDL_Time *ticks)
 {
-    static pfnGetSystemTimePreciseAsFileTime pGetSystemTimePreciseAsFileTime = NULL;
-    static SDL_bool load_attempted = SDL_FALSE;
     FILETIME ft;
 
     if (!ticks) {
         return SDL_InvalidParamError("ticks");
     }
 
+    SDL_zero(ft);
+
+#ifdef SDL_PLATFORM_WINRT
+    GetSystemTimePreciseAsFileTime(&ft);
+#else
+    static pfnGetSystemTimePreciseAsFileTime pGetSystemTimePreciseAsFileTime = NULL;
+    static SDL_bool load_attempted = SDL_FALSE;
+
     /* Only available in Win8/Server 2012 or higher. */
     if (!pGetSystemTimePreciseAsFileTime && !load_attempted) {
         HANDLE kernel32 = GetModuleHandle(TEXT("kernel32.dll"));
@@ -96,12 +102,13 @@ int SDL_GetCurrentTime(SDL_Time *ticks)
         load_attempted = SDL_TRUE;
     }
 
-    SDL_zero(ft);
     if (pGetSystemTimePreciseAsFileTime) {
         pGetSystemTimePreciseAsFileTime(&ft);
     } else {
         GetSystemTimeAsFileTime(&ft);
     }
+#endif
+
     *ticks = SDL_TimeFromWindows(ft.dwLowDateTime, ft.dwHighDateTime);
 
     return 0;