src/audio/xaudio2/SDL_xaudio2.c
changeset 5615 5e060b67c73d
parent 5593 ab22ca13c47f
child 5634 093e60544778
     1.1 --- a/src/audio/xaudio2/SDL_xaudio2.c	Thu Aug 18 22:43:37 2011 +0200
     1.2 +++ b/src/audio/xaudio2/SDL_xaudio2.c	Sun Aug 21 02:35:13 2011 -0400
     1.3 @@ -27,6 +27,8 @@
     1.4  #define INITGUID 1
     1.5  #include "SDL_xaudio2.h"
     1.6  
     1.7 +#if SDL_HAVE_XAUDIO2_H
     1.8 +
     1.9  static __inline__ char *
    1.10  utf16_to_utf8(const WCHAR *S)
    1.11  {
    1.12 @@ -370,9 +372,15 @@
    1.13      WIN_CoUninitialize();
    1.14  }
    1.15  
    1.16 +#endif  /* SDL_HAVE_XAUDIO2_H */
    1.17 +
    1.18 +
    1.19  static int
    1.20  XAUDIO2_Init(SDL_AudioDriverImpl * impl)
    1.21  {
    1.22 +#if !SDL_HAVE_XAUDIO2_H
    1.23 +    return 0;  /* no XAudio2 support, ever. Update your SDK! */
    1.24 +#else
    1.25      /* XAudio2Create() is a macro that uses COM; we don't load the .dll */
    1.26      IXAudio2 *ixa2 = NULL;
    1.27      if (FAILED(WIN_CoInitialize())) {
    1.28 @@ -398,6 +406,7 @@
    1.29      impl->Deinitialize = XAUDIO2_Deinitialize;
    1.30  
    1.31      return 1;   /* this audio target is available. */
    1.32 +#endif
    1.33  }
    1.34  
    1.35  AudioBootStrap XAUDIO2_bootstrap = {