Move tests from SDL_config higher up in Windows joystick/haptic code.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 28 May 2015 00:54:52 -0400
changeset 96589753468b5c0e
parent 9657 fbc01731d914
child 9659 839c0c3bf555
Move tests from SDL_config higher up in Windows joystick/haptic code.

Fixes Bugzilla #2932.
src/haptic/windows/SDL_dinputhaptic.c
src/haptic/windows/SDL_xinputhaptic.c
src/joystick/windows/SDL_dinputjoystick.c
src/joystick/windows/SDL_xinputjoystick.c
     1.1 --- a/src/haptic/windows/SDL_dinputhaptic.c	Thu May 28 00:30:21 2015 -0400
     1.2 +++ b/src/haptic/windows/SDL_dinputhaptic.c	Thu May 28 00:54:52 2015 -0400
     1.3 @@ -20,6 +20,8 @@
     1.4  */
     1.5  #include "../../SDL_internal.h"
     1.6  
     1.7 +#if SDL_HAPTIC_DINPUT
     1.8 +
     1.9  #include "SDL_error.h"
    1.10  #include "SDL_stdinc.h"
    1.11  #include "SDL_haptic.h"
    1.12 @@ -29,9 +31,6 @@
    1.13  #include "../SDL_syshaptic.h"
    1.14  #include "../../joystick/windows/SDL_windowsjoystick_c.h"
    1.15  
    1.16 -
    1.17 -#if SDL_HAPTIC_DINPUT
    1.18 -
    1.19  /*
    1.20   * External stuff.
    1.21   */
    1.22 @@ -1181,7 +1180,6 @@
    1.23  
    1.24  #else /* !SDL_HAPTIC_DINPUT */
    1.25  
    1.26 -
    1.27  int
    1.28  SDL_DINPUT_HapticInit(void)
    1.29  {
     2.1 --- a/src/haptic/windows/SDL_xinputhaptic.c	Thu May 28 00:30:21 2015 -0400
     2.2 +++ b/src/haptic/windows/SDL_xinputhaptic.c	Thu May 28 00:54:52 2015 -0400
     2.3 @@ -20,6 +20,8 @@
     2.4  */
     2.5  #include "../../SDL_internal.h"
     2.6  
     2.7 +#if SDL_HAPTIC_XINPUT
     2.8 +
     2.9  #include "SDL_assert.h"
    2.10  #include "SDL_error.h"
    2.11  #include "SDL_haptic.h"
    2.12 @@ -31,9 +33,6 @@
    2.13  #include "../../core/windows/SDL_xinput.h"
    2.14  #include "../../joystick/windows/SDL_windowsjoystick_c.h"
    2.15  
    2.16 -
    2.17 -#if SDL_HAPTIC_XINPUT
    2.18 -
    2.19  /*
    2.20   * Internal stuff.
    2.21   */
    2.22 @@ -488,4 +487,5 @@
    2.23  }
    2.24  
    2.25  #endif /* SDL_HAPTIC_XINPUT */
    2.26 +
    2.27  /* vi: set ts=4 sw=4 expandtab: */
     3.1 --- a/src/joystick/windows/SDL_dinputjoystick.c	Thu May 28 00:30:21 2015 -0400
     3.2 +++ b/src/joystick/windows/SDL_dinputjoystick.c	Thu May 28 00:54:52 2015 -0400
     3.3 @@ -20,14 +20,13 @@
     3.4  */
     3.5  #include "../../SDL_internal.h"
     3.6  
     3.7 +#if SDL_JOYSTICK_DINPUT
     3.8 +
     3.9  #include "../SDL_sysjoystick.h"
    3.10  #include "SDL_windowsjoystick_c.h"
    3.11  #include "SDL_dinputjoystick_c.h"
    3.12  #include "SDL_xinputjoystick_c.h"
    3.13  
    3.14 -
    3.15 -#if SDL_JOYSTICK_DINPUT
    3.16 -
    3.17  #ifndef DIDFT_OPTIONAL
    3.18  #define DIDFT_OPTIONAL      0x80000000
    3.19  #endif
     4.1 --- a/src/joystick/windows/SDL_xinputjoystick.c	Thu May 28 00:30:21 2015 -0400
     4.2 +++ b/src/joystick/windows/SDL_xinputjoystick.c	Thu May 28 00:54:52 2015 -0400
     4.3 @@ -20,15 +20,14 @@
     4.4  */
     4.5  #include "../../SDL_internal.h"
     4.6  
     4.7 +#if SDL_JOYSTICK_XINPUT
     4.8 +
     4.9  #include "SDL_assert.h"
    4.10  #include "SDL_hints.h"
    4.11  #include "../SDL_sysjoystick.h"
    4.12  #include "SDL_windowsjoystick_c.h"
    4.13  #include "SDL_xinputjoystick_c.h"
    4.14  
    4.15 -
    4.16 -#if SDL_JOYSTICK_XINPUT
    4.17 -
    4.18  /*
    4.19   * Internal stuff.
    4.20   */