(libusb) Another API not C89-compliantl

This commit is contained in:
twinaphex 2015-06-29 23:19:02 +02:00
parent f1a1f3531b
commit 80142af594
2 changed files with 16 additions and 5 deletions

View File

@ -479,6 +479,8 @@ ifeq ($(HAVE_UDEV), 1)
input/drivers_joypad/udev_joypad.o
endif
ifneq ($(C89_BUILD), 1)
# PulseAudio is not a C89-compliant API.
ifeq ($(HAVE_LIBUSB), 1)
DEFINES += -DHAVE_LIBUSB
OBJ += input/drivers_hid/libusb_hid.o
@ -486,6 +488,7 @@ ifeq ($(HAVE_LIBUSB), 1)
JOYCONFIG_LIBS += -lusb-1.0
HAVE_HID = 1
endif
endif
ifeq ($(HAVE_IOHIDMANAGER), 1)
DEFINES += -DHAVE_IOHIDMANAGER

View File

@ -149,7 +149,9 @@ static void libusb_get_description(struct libusb_device *device,
{
const struct libusb_interface_descriptor *interdesc = &inter->altsetting[j];
//if (interdesc->bInterfaceClass == LIBUSB_CLASS_HID)
#if 0
if (interdesc->bInterfaceClass == LIBUSB_CLASS_HID)
#endif
{
adapter->interface_number = (int)interdesc->bInterfaceNumber;
@ -212,7 +214,9 @@ static int add_adapter(void *data, struct libusb_device *dev)
if (adapter->endpoint_in == 0)
{
//fprintf(stderr, "Could not find HID config for device.\n");
#if 0
fprintf(stderr, "Could not find HID config for device.\n");
#endif
goto error;
}
@ -221,7 +225,7 @@ static int add_adapter(void *data, struct libusb_device *dev)
if (rc != LIBUSB_SUCCESS)
{
fprintf(stderr, "Error opening device 0x%p (VID/PID: %04x:%04x).\n",
adapter->device, desc.idVendor, desc.idProduct);
(void*)adapter->device, desc.idVendor, desc.idProduct);
goto error;
}
@ -230,7 +234,9 @@ static int add_adapter(void *data, struct libusb_device *dev)
libusb_get_string_descriptor_ascii(adapter->handle,
desc.iManufacturer, adapter->manufacturer_name,
sizeof(adapter->manufacturer_name));
//fprintf(stderr, " Adapter Manufacturer name: %s\n", adapter->manufacturer_name);
#if 0
fprintf(stderr, " Adapter Manufacturer name: %s\n", adapter->manufacturer_name);
#endif
}
if (desc.iProduct)
@ -238,7 +244,9 @@ static int add_adapter(void *data, struct libusb_device *dev)
libusb_get_string_descriptor_ascii(adapter->handle,
desc.iProduct, adapter->name,
sizeof(adapter->name));
//fprintf(stderr, " Adapter name: %s\n", adapter->name);
#if 0
fprintf(stderr, " Adapter name: %s\n", adapter->name);
#endif
}
device_name = (const char*)adapter->name;