Probable fix for compile errors on Mac OS and (non-VS) Win32

This commit is contained in:
Jimb Esser
2020-03-20 19:49:19 -07:00
parent dc36f133b4
commit 417713a75c
2 changed files with 11 additions and 3 deletions

View File

@@ -241,6 +241,7 @@ static SDL_HIDAPI_DeviceDriver *
RAWINPUT_GetDeviceDriver(SDL_RAWINPUT_Device *device)
{
int i;
SDL_GameControllerType type;
if (SDL_ShouldIgnoreJoystick(device->name, device->guid)) {
return NULL;
@@ -253,7 +254,7 @@ RAWINPUT_GetDeviceDriver(SDL_RAWINPUT_Device *device)
return NULL;
}
SDL_GameControllerType type = SDL_GetJoystickGameControllerType("", device->vendor_id, device->product_id, -1, 0, 0, 0);
type = SDL_GetJoystickGameControllerType("", device->vendor_id, device->product_id, -1, 0, 0, 0);
for (i = 0; i < SDL_arraysize(SDL_RAWINPUT_drivers); ++i) {
SDL_HIDAPI_DeviceDriver *driver = SDL_RAWINPUT_drivers[i];
@@ -365,6 +366,7 @@ RAWINPUT_DelDevice(SDL_RAWINPUT_Device *device, SDL_bool send_event)
SDL_RAWINPUT_Device *curr, *last;
for (curr = SDL_RAWINPUT_devices, last = NULL; curr; last = curr, curr = curr->next) {
if (curr == device) {
SDL_Joystick *joystick;
if (last) {
last->next = curr->next;
} else {
@@ -372,7 +374,7 @@ RAWINPUT_DelDevice(SDL_RAWINPUT_Device *device, SDL_bool send_event)
}
--SDL_RAWINPUT_numjoysticks;
SDL_Joystick *joystick = device->joystick;
joystick = device->joystick;
if (joystick) {
/* Detach from joystick */
RAWINPUT_JoystickClose(joystick);