src/joystick/windows/SDL_windowsjoystick.c
changeset 13944 b8c8ce11efc7
parent 13873 5bb6be4f2425
     1.1 --- a/src/joystick/windows/SDL_windowsjoystick.c	Sun Jul 05 22:33:10 2020 +0300
     1.2 +++ b/src/joystick/windows/SDL_windowsjoystick.c	Wed Jul 08 17:28:34 2020 +0200
     1.3 @@ -359,9 +359,13 @@
     1.4          JoyStick_DeviceData *pListNext = NULL;
     1.5  
     1.6          if (pCurList->bXInputDevice) {
     1.7 +#if SDL_HAPTIC_XINPUT
     1.8              SDL_XINPUT_MaybeRemoveDevice(pCurList->XInputUserId);
     1.9 +#endif
    1.10          } else {
    1.11 +#if SDL_HAPTIC_DINPUT
    1.12              SDL_DINPUT_MaybeRemoveDevice(&pCurList->dxdevice);
    1.13 +#endif
    1.14          }
    1.15  
    1.16          SDL_PrivateJoystickRemoved(pCurList->nInstanceID);
    1.17 @@ -380,9 +384,13 @@
    1.18          while (pNewJoystick) {
    1.19              if (pNewJoystick->send_add_event) {
    1.20                  if (pNewJoystick->bXInputDevice) {
    1.21 +#if SDL_HAPTIC_XINPUT
    1.22                      SDL_XINPUT_MaybeAddDevice(pNewJoystick->XInputUserId);
    1.23 +#endif
    1.24                  } else {
    1.25 +#if SDL_HAPTIC_DINPUT
    1.26                      SDL_DINPUT_MaybeAddDevice(&pNewJoystick->dxdevice);
    1.27 +#endif
    1.28                  }
    1.29  
    1.30                  SDL_PrivateJoystickAdded(pNewJoystick->nInstanceID);