wasapi: properly report init failure if on pre-Vista version of Windows.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 28 May 2017 00:41:55 -0400
changeset 110408ff2f9651a0e
parent 11039 d0e35a9ba1f6
child 11041 5aebcca5ff18
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.
src/audio/wasapi/SDL_wasapi.c
     1.1 --- a/src/audio/wasapi/SDL_wasapi.c	Sat May 27 23:30:21 2017 +0200
     1.2 +++ b/src/audio/wasapi/SDL_wasapi.c	Sun May 28 00:41:55 2017 -0400
     1.3 @@ -909,7 +909,8 @@
     1.4  
     1.5      /* just skip the discussion with COM here. */
     1.6      if (!WIN_IsWindowsVistaOrGreater()) {
     1.7 -        return SDL_SetError("WASAPI support requires Windows Vista or later");
     1.8 +        SDL_SetError("WASAPI support requires Windows Vista or later");
     1.9 +        return 0;
    1.10      }
    1.11  
    1.12      SDL_AtomicSet(&default_playback_generation, 1);