Fixed duplicate controller entries on Mac OS X when using libusb, due to the HID interface number not being available in the Mac OS X HID code.
authorSam Lantinga <slouken@libsdl.org>
Fri, 20 Dec 2019 21:00:16 -0800
changeset 13370a67f6a4199a9
parent 13369 d73580c86f81
child 13371 58440332819a
Fixed duplicate controller entries on Mac OS X when using libusb, due to the HID interface number not being available in the Mac OS X HID code.
src/hidapi/SDL_hidapi.c
     1.1 --- a/src/hidapi/SDL_hidapi.c	Fri Dec 20 20:12:03 2019 -0800
     1.2 +++ b/src/hidapi/SDL_hidapi.c	Fri Dec 20 21:00:16 2019 -0800
     1.3 @@ -559,7 +559,7 @@
     1.4              for (raw_dev = raw_devs; raw_dev; raw_dev = raw_dev->next) {
     1.5                  if (usb_dev->vendor_id == raw_dev->vendor_id &&
     1.6                      usb_dev->product_id == raw_dev->product_id &&
     1.7 -                    usb_dev->interface_number == raw_dev->interface_number) {
     1.8 +                    (raw_dev->interface_number < 0 || usb_dev->interface_number == raw_dev->interface_number)) {
     1.9                      bFound = SDL_TRUE;
    1.10                      break;
    1.11                  }