src/joystick/windows/SDL_dxjoystick.c
changeset 7260 7601833a69ee
parent 7230 757e9812ef1c
child 7265 3bb309bb6bfe
     1.1 --- a/src/joystick/windows/SDL_dxjoystick.c	Sun Jun 02 01:12:29 2013 -0700
     1.2 +++ b/src/joystick/windows/SDL_dxjoystick.c	Sun Jun 02 01:35:38 2013 -0700
     1.3 @@ -35,19 +35,44 @@
     1.4  #include "SDL_error.h"
     1.5  #include "SDL_assert.h"
     1.6  #include "SDL_events.h"
     1.7 -#include "SDL_joystick.h"
     1.8 -#include "../SDL_sysjoystick.h"
     1.9 -#define INITGUID /* Only set here, if set twice will cause mingw32 to break. */
    1.10 -#include "SDL_dxjoystick_c.h"
    1.11  #include "SDL_thread.h"
    1.12  #include "SDL_timer.h"
    1.13  #include "SDL_mutex.h"
    1.14  #include "SDL_events.h"
    1.15  #include "SDL_hints.h"
    1.16 +#include "SDL_joystick.h"
    1.17 +#include "../SDL_sysjoystick.h"
    1.18  #if !SDL_EVENTS_DISABLED
    1.19  #include "../../events/SDL_events_c.h"
    1.20  #endif
    1.21  
    1.22 +/* The latest version of mingw-w64 defines IID_IWbemLocator in wbemcli.h
    1.23 +   instead of declaring it like Visual Studio and other mingw32 compilers.
    1.24 +   So, we need to take care of this here before we define INITGUID.
    1.25 +*/
    1.26 +#ifdef __MINGW32__
    1.27 +#define __IWbemLocator_INTERFACE_DEFINED__
    1.28 +#endif /* __MINGW32__ */
    1.29 +
    1.30 +#define INITGUID /* Only set here, if set twice will cause mingw32 to break. */
    1.31 +#include "SDL_dxjoystick_c.h"
    1.32 +
    1.33 +#ifdef __MINGW32__
    1.34 +/* And now that we've included wbemcli.h we need to declare these interfaces */
    1.35 +typedef struct IWbemLocatorVtbl {
    1.36 +  BEGIN_INTERFACE
    1.37 +    HRESULT (WINAPI *QueryInterface)(IWbemLocator *This,REFIID riid,void **ppvObject);
    1.38 +    ULONG (WINAPI *AddRef)(IWbemLocator *This);
    1.39 +    ULONG (WINAPI *Release)(IWbemLocator *This);
    1.40 +    HRESULT (WINAPI *ConnectServer)(IWbemLocator *This,const BSTR strNetworkResource,const BSTR strUser,const BSTR strPassword,const BSTR strLocale,__LONG32 lSecurityFlags,const BSTR strAuthority,IWbemContext *pCtx,IWbemServices **ppNamespace);
    1.41 +  END_INTERFACE
    1.42 +} IWbemLocatorVtbl;
    1.43 +struct IWbemLocator {
    1.44 +  CONST_VTBL struct IWbemLocatorVtbl *lpVtbl;
    1.45 +};
    1.46 +#define IWbemLocator_ConnectServer(This,strNetworkResource,strUser,strPassword,strLocale,lSecurityFlags,strAuthority,pCtx,ppNamespace) (This)->lpVtbl->ConnectServer(This,strNetworkResource,strUser,strPassword,strLocale,lSecurityFlags,strAuthority,pCtx,ppNamespace)
    1.47 +#endif /* __MINGW32__ */
    1.48 +
    1.49  #ifndef DIDFT_OPTIONAL
    1.50  #define DIDFT_OPTIONAL      0x80000000
    1.51  #endif
    1.52 @@ -373,10 +398,8 @@
    1.53  
    1.54  
    1.55  DEFINE_GUID(CLSID_WbemLocator,   0x4590f811,0x1d3a,0x11d0,0x89,0x1F,0x00,0xaa,0x00,0x4b,0x2e,0x24);
    1.56 -#ifdef _MSC_VER
    1.57  /* The Windows SDK doesn't define this GUID */
    1.58  DEFINE_GUID(IID_IWbemLocator,    0xdc12a687,0x737f,0x11cf,0x88,0x4d,0x00,0xaa,0x00,0x4b,0x2e,0x24);
    1.59 -#endif /* _MSC_VER */
    1.60  
    1.61  /*-----------------------------------------------------------------------------
    1.62   *