Răsfoiți Sursa

wasapi: properly report init failure if on pre-Vista version of Windows.

We really should change the Init interface to return 0 on success and -1 on
error, like everything else, to avoid this sort of confusion.
Ryan C. Gordon 8 ani în urmă
părinte
comite
e5918acf46
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      src/audio/wasapi/SDL_wasapi.c

+ 2 - 1
src/audio/wasapi/SDL_wasapi.c

@@ -909,7 +909,8 @@ WASAPI_Init(SDL_AudioDriverImpl * impl)
 
     /* just skip the discussion with COM here. */
     if (!WIN_IsWindowsVistaOrGreater()) {
-        return SDL_SetError("WASAPI support requires Windows Vista or later");
+        SDL_SetError("WASAPI support requires Windows Vista or later");
+        return 0;
     }
 
     SDL_AtomicSet(&default_playback_generation, 1);