Browse Source

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

(cherry picked from commit fcd1c155ccec7ac57b77cbc8571a321a5954c2cb)
Ozkan Sezer 1 year ago
parent
commit
2a4db8c415
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/file/SDL_rwops.c

+ 1 - 1
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