SDL: SDL_rwops.c (SDL_IsRegularFile): fix WinRT build failure due to S_ISREG (2a4db)

From 2a4db8c4156f25f40af54dacdb5746c918ba9d3a Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 28 Jan 2024 02:20:00 +0300
Subject: [PATCH] SDL_rwops.c (SDL_IsRegularFile): fix WinRT build failure due
 to S_ISREG

(cherry picked from commit fcd1c155ccec7ac57b77cbc8571a321a5954c2cb)
---
 src/file/SDL_rwops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c
index 18a389a00bb9..6589a20ddc1b 100644
--- a/src/file/SDL_rwops.c
+++ b/src/file/SDL_rwops.c
@@ -465,7 +465,7 @@ static SDL_bool SDL_IsRegularFile(FILE *f)
 {
     #ifdef SDL_PLATFORM_WINRT
     struct __stat64 st;
-    if (_fstat64(_fileno(f), &st) < 0 || !S_ISREG(st.st_mode)) {
+    if (_fstat64(_fileno(f), &st) < 0 || (st.st_mode & _S_IFMT) != _S_IFREG) {
         return SDL_FALSE;
     }
     #else