Let XAudio2 target be removed from the build by removing it from SDL_config.h
authorRyan C. Gordon <icculus@icculus.org>
Mon, 22 Aug 2011 14:30:49 -0400
changeset 5634 093e60544778
parent 5633 21a6e87905e3
child 5635 bef0f093c9da
Let XAudio2 target be removed from the build by removing it from SDL_config.h
src/audio/xaudio2/SDL_xaudio2.c
src/audio/xaudio2/SDL_xaudio2.h
--- a/src/audio/xaudio2/SDL_xaudio2.c	Mon Aug 22 14:25:11 2011 -0400
+++ b/src/audio/xaudio2/SDL_xaudio2.c	Mon Aug 22 14:30:49 2011 -0400
@@ -27,7 +27,7 @@
 #define INITGUID 1
 #include "SDL_xaudio2.h"
 
-#if SDL_HAVE_XAUDIO2_H
+#ifdef SDL_HAVE_XAUDIO2_H
 
 static __inline__ char *
 utf16_to_utf8(const WCHAR *S)
--- a/src/audio/xaudio2/SDL_xaudio2.h	Mon Aug 22 14:25:11 2011 -0400
+++ b/src/audio/xaudio2/SDL_xaudio2.h	Mon Aug 22 14:30:49 2011 -0400
@@ -25,15 +25,14 @@
 
 #include "../SDL_sysaudio.h"
 
-/* XAudio2 is available as of the March 2008 DirectX SDK */
-#include <dxsdkver.h>
+#if SDL_AUDIO_DRIVER_XAUDIO2
+#include <dxsdkver.h> /* XAudio2 exists as of the March 2008 DirectX SDK */
 #if (defined(_DXSDK_BUILD_MAJOR) && (_DXSDK_BUILD_MAJOR >= 1284))
 #   define SDL_HAVE_XAUDIO2_H 1
-#else
-#   define SDL_HAVE_XAUDIO2_H 0
+#endif
 #endif
 
-#if SDL_HAVE_XAUDIO2_H
+#ifdef SDL_HAVE_XAUDIO2_H
 #include <XAudio2.h>
 
 /* Hidden "this" pointer for the audio functions */