[Commits] SDL: wasapi: properly report init failure if on pre-Vista versio...

libsdl.org revision control commits-owner at libsdl.org
Sat May 27 21:42:06 PDT 2017


details:   https://hg.libsdl.org/SDL/rev/8ff2f9651a0e
changeset: 11040:8ff2f9651a0e
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Sun May 28 00:41:55 2017 -0400
description:
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.

diffstat:

 src/audio/wasapi/SDL_wasapi.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r d0e35a9ba1f6 -r 8ff2f9651a0e src/audio/wasapi/SDL_wasapi.c
--- a/src/audio/wasapi/SDL_wasapi.c	Sat May 27 23:30:21 2017 +0200
+++ b/src/audio/wasapi/SDL_wasapi.c	Sun May 28 00:41:55 2017 -0400
@@ -909,7 +909,8 @@
 
     /* 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);


More information about the commits mailing list