Move tests from SDL_config higher up in Windows joystick/haptic code. Fixes Bugzilla #2932.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
diff --git a/src/haptic/windows/SDL_dinputhaptic.c b/src/haptic/windows/SDL_dinputhaptic.c
index 564c7db..21ccace 100644
--- a/src/haptic/windows/SDL_dinputhaptic.c
+++ b/src/haptic/windows/SDL_dinputhaptic.c
@@ -20,6 +20,8 @@
*/
#include "../../SDL_internal.h"
+#if SDL_HAPTIC_DINPUT
+
#include "SDL_error.h"
#include "SDL_stdinc.h"
#include "SDL_haptic.h"
@@ -29,9 +31,6 @@
#include "../SDL_syshaptic.h"
#include "../../joystick/windows/SDL_windowsjoystick_c.h"
-
-#if SDL_HAPTIC_DINPUT
-
/*
* External stuff.
*/
@@ -1181,7 +1180,6 @@ SDL_DINPUT_HapticStopAll(SDL_Haptic * haptic)
#else /* !SDL_HAPTIC_DINPUT */
-
int
SDL_DINPUT_HapticInit(void)
{
diff --git a/src/haptic/windows/SDL_xinputhaptic.c b/src/haptic/windows/SDL_xinputhaptic.c
index 97d95aa..b2c64d7 100644
--- a/src/haptic/windows/SDL_xinputhaptic.c
+++ b/src/haptic/windows/SDL_xinputhaptic.c
@@ -20,6 +20,8 @@
*/
#include "../../SDL_internal.h"
+#if SDL_HAPTIC_XINPUT
+
#include "SDL_assert.h"
#include "SDL_error.h"
#include "SDL_haptic.h"
@@ -31,9 +33,6 @@
#include "../../core/windows/SDL_xinput.h"
#include "../../joystick/windows/SDL_windowsjoystick_c.h"
-
-#if SDL_HAPTIC_XINPUT
-
/*
* Internal stuff.
*/
@@ -488,4 +487,5 @@ SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic)
}
#endif /* SDL_HAPTIC_XINPUT */
+
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c
index c612cdd..476ee98 100644
--- a/src/joystick/windows/SDL_dinputjoystick.c
+++ b/src/joystick/windows/SDL_dinputjoystick.c
@@ -20,14 +20,13 @@
*/
#include "../../SDL_internal.h"
+#if SDL_JOYSTICK_DINPUT
+
#include "../SDL_sysjoystick.h"
#include "SDL_windowsjoystick_c.h"
#include "SDL_dinputjoystick_c.h"
#include "SDL_xinputjoystick_c.h"
-
-#if SDL_JOYSTICK_DINPUT
-
#ifndef DIDFT_OPTIONAL
#define DIDFT_OPTIONAL 0x80000000
#endif
diff --git a/src/joystick/windows/SDL_xinputjoystick.c b/src/joystick/windows/SDL_xinputjoystick.c
index da9a2f7..9042d57 100644
--- a/src/joystick/windows/SDL_xinputjoystick.c
+++ b/src/joystick/windows/SDL_xinputjoystick.c
@@ -20,15 +20,14 @@
*/
#include "../../SDL_internal.h"
+#if SDL_JOYSTICK_XINPUT
+
#include "SDL_assert.h"
#include "SDL_hints.h"
#include "../SDL_sysjoystick.h"
#include "SDL_windowsjoystick_c.h"
#include "SDL_xinputjoystick_c.h"
-
-#if SDL_JOYSTICK_XINPUT
-
/*
* Internal stuff.
*/