src/audio/xaudio2/SDL_xaudio2.c
changeset 5615 5e060b67c73d
parent 5593 ab22ca13c47f
child 5634 093e60544778
--- a/src/audio/xaudio2/SDL_xaudio2.c	Thu Aug 18 22:43:37 2011 +0200
+++ b/src/audio/xaudio2/SDL_xaudio2.c	Sun Aug 21 02:35:13 2011 -0400
@@ -27,6 +27,8 @@
 #define INITGUID 1
 #include "SDL_xaudio2.h"
 
+#if SDL_HAVE_XAUDIO2_H
+
 static __inline__ char *
 utf16_to_utf8(const WCHAR *S)
 {
@@ -370,9 +372,15 @@
     WIN_CoUninitialize();
 }
 
+#endif  /* SDL_HAVE_XAUDIO2_H */
+
+
 static int
 XAUDIO2_Init(SDL_AudioDriverImpl * impl)
 {
+#if !SDL_HAVE_XAUDIO2_H
+    return 0;  /* no XAudio2 support, ever. Update your SDK! */
+#else
     /* XAudio2Create() is a macro that uses COM; we don't load the .dll */
     IXAudio2 *ixa2 = NULL;
     if (FAILED(WIN_CoInitialize())) {
@@ -398,6 +406,7 @@
     impl->Deinitialize = XAUDIO2_Deinitialize;
 
     return 1;   /* this audio target is available. */
+#endif
 }
 
 AudioBootStrap XAUDIO2_bootstrap = {