[Commits] SDL: Fixed mingw-w64 build

libsdl.org revision control commits-owner at libsdl.org
Fri Sep 28 01:00:50 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/0c1c3e41a6f2
changeset: 12245:0c1c3e41a6f2
user:      Sam Lantinga <slouken at libsdl.org>
date:      Fri Sep 28 01:00:47 2018 -0700
description:
Fixed mingw-w64 build

diffstat:

 configure                            |  15 +++++++--------
 configure.in                         |  11 +++++------
 src/hidapi/windows/hid.c             |   1 +
 src/joystick/hidapi/SDL_hidapi_ps4.c |  10 +++++-----
 4 files changed, 18 insertions(+), 19 deletions(-)

diffs (111 lines):

diff -r 63282fe5089e -r 0c1c3e41a6f2 configure
--- a/configure	Fri Sep 28 00:40:35 2018 -0700
+++ b/configure	Fri Sep 28 01:00:47 2018 -0700
@@ -24296,16 +24296,15 @@
 $as_echo "#define SDL_JOYSTICK_WINMM 1" >>confdefs.h
 
             fi
+
+$as_echo "#define SDL_JOYSTICK_HIDAPI 1" >>confdefs.h
+
             SOURCES="$SOURCES $srcdir/src/joystick/windows/*.c"
+            SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
+            SOURCES="$SOURCES $srcdir/src/hidapi/windows/hid.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
             have_joystick=yes
         fi
-        if test x$enable_joystick = xyes -a x$enable_hidapi = xyes; then
-
-$as_echo "#define SDL_JOYSTICK_HIDAPI 1" >>confdefs.h
-
-            EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
-            SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
-        fi
         if test x$enable_haptic = xyes; then
             if test x$have_dinput = xyes -o x$have_xinput = xyes; then
                 if test x$have_xinput = xyes; then
@@ -24367,7 +24366,7 @@
         else
             LIBUUID=-luuid
         fi
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -static-libgcc"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion $LIBUUID -static-libgcc"
         # The Windows platform requires special setup
         VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
         SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
diff -r 63282fe5089e -r 0c1c3e41a6f2 configure.in
--- a/configure.in	Fri Sep 28 00:40:35 2018 -0700
+++ b/configure.in	Fri Sep 28 01:00:47 2018 -0700
@@ -3628,14 +3628,13 @@
             else
                 AC_DEFINE(SDL_JOYSTICK_WINMM, 1, [ ])
             fi
+            AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
             SOURCES="$SOURCES $srcdir/src/joystick/windows/*.c"
+            SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
+            SOURCES="$SOURCES $srcdir/src/hidapi/windows/hid.c"
+            EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
             have_joystick=yes
         fi
-        if test x$enable_joystick = xyes -a x$enable_hidapi = xyes; then
-            AC_DEFINE(SDL_JOYSTICK_HIDAPI, 1, [ ])
-            EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
-            SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
-        fi
         if test x$enable_haptic = xyes; then
             if test x$have_dinput = xyes -o x$have_xinput = xyes; then
                 if test x$have_xinput = xyes; then
@@ -3683,7 +3682,7 @@
         else
             LIBUUID=-luuid
         fi
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -static-libgcc"
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion $LIBUUID -static-libgcc"
         # The Windows platform requires special setup
         VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
         SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
diff -r 63282fe5089e -r 0c1c3e41a6f2 src/hidapi/windows/hid.c
--- a/src/hidapi/windows/hid.c	Fri Sep 28 00:40:35 2018 -0700
+++ b/src/hidapi/windows/hid.c	Fri Sep 28 01:00:47 2018 -0700
@@ -37,6 +37,7 @@
 #endif
 
 /* SDL C runtime functions */
+#include "../../SDL_internal.h"
 #include "SDL_stdinc.h"
 
 #define calloc SDL_calloc
diff -r 63282fe5089e -r 0c1c3e41a6f2 src/joystick/hidapi/SDL_hidapi_ps4.c
--- a/src/joystick/hidapi/SDL_hidapi_ps4.c	Fri Sep 28 00:40:35 2018 -0700
+++ b/src/joystick/hidapi/SDL_hidapi_ps4.c	Fri Sep 28 01:00:47 2018 -0700
@@ -162,9 +162,9 @@
 
 #undef DEFINE_GUID
 #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) static const GUID n = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-DEFINE_GUID(CLSID_MMDeviceEnumerator, 0xBCDE0395, 0xE52F, 0x467C, 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E);
-DEFINE_GUID(IID_IMMDeviceEnumerator, 0xA95664D2, 0x9614, 0x4F35, 0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6);
-DEFINE_GUID(IID_IAudioEndpointVolume, 0x5CDF2C82, 0x841E, 0x4546, 0x97, 0x22, 0x0C, 0xF7, 0x40, 0x78, 0x22, 0x9A);
+DEFINE_GUID(SDL_CLSID_MMDeviceEnumerator, 0xBCDE0395, 0xE52F, 0x467C, 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E);
+DEFINE_GUID(SDL_IID_IMMDeviceEnumerator, 0xA95664D2, 0x9614, 0x4F35, 0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6);
+DEFINE_GUID(SDL_IID_IAudioEndpointVolume, 0x5CDF2C82, 0x841E, 0x4546, 0x97, 0x22, 0x0C, 0xF7, 0x40, 0x78, 0x22, 0x9A);
 #endif
 
 
@@ -179,7 +179,7 @@
         IMMDeviceEnumerator *pEnumerator;
 
         /* This should gracefully fail on XP and succeed on everything Vista and above */
-        hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &IID_IMMDeviceEnumerator, (LPVOID*)&pEnumerator);
+        hr = CoCreateInstance(&SDL_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &SDL_IID_IMMDeviceEnumerator, (LPVOID*)&pEnumerator);
         if (SUCCEEDED(hr)) {
             IMMDevice *pDevice;
 
@@ -187,7 +187,7 @@
             if (SUCCEEDED(hr)) {
                 IAudioEndpointVolume *pEndpointVolume;
 
-                hr = IMMDevice_Activate(pDevice, &IID_IAudioEndpointVolume, CLSCTX_ALL, NULL, (LPVOID*)&pEndpointVolume);
+                hr = IMMDevice_Activate(pDevice, &SDL_IID_IAudioEndpointVolume, CLSCTX_ALL, NULL, (LPVOID*)&pEndpointVolume);
                 if (SUCCEEDED(hr)) {
                     IAudioEndpointVolume_GetMasterVolumeLevelScalar(pEndpointVolume, &volume);
                     IUnknown_Release(pEndpointVolume);


More information about the commits mailing list