Просмотр исходного кода

sdl3: The compiler gets upset about using a ternary operator here.

Ryan C. Gordon 2 дней назад
Родитель
Сommit
9d904e39dd
1 измененных файлов с 7 добавлено и 4 удалено
  1. 7 4
      src/physfs_platform_sdl3.c

+ 7 - 4
src/physfs_platform_sdl3.c

@@ -120,16 +120,19 @@ PHYSFS_EnumerateCallbackResult __PHYSFS_platformEnumerate(const char *dirname,
                                                           const char *origdir,
                                                           void *callbackdata)
 {
+    bool rc;
     platformEnumerateContext ctx;
+
     ctx.callback = callback;
     ctx.origdir = origdir;
     ctx.callbackdata = callbackdata;
     ctx.result = PHYSFS_ENUM_OK;
 
-    BAIL_IF(!SDL_EnumerateDirectory(dirname, platformEnumerateCallback, &ctx),
-            /* Determine the correct PhysFS error to report. */
-            ctx.result == PHYSFS_ENUM_ERROR ? PHYSFS_ERR_APP_CALLBACK : PHYSFS_ERR_OS_ERROR,
-            PHYSFS_ENUM_ERROR);
+    rc = SDL_EnumerateDirectory(dirname, platformEnumerateCallback, &ctx);
+    if (!rc) {
+        PHYSFS_setErrorCode((ctx.result == PHYSFS_ENUM_ERROR) ? PHYSFS_ERR_APP_CALLBACK : PHYSFS_ERR_OS_ERROR);
+        return PHYSFS_ENUM_ERROR;
+    }
 
     return ctx.result;
 } /* __PHYSFS_platformEnumerate */