]> git.proxmox.com Git - qemu.git/commitdiff
usb/host-libusb: Fix building with libusb git master code
authorHans de Goede <hdegoede@redhat.com>
Thu, 6 Jun 2013 14:39:34 +0000 (16:39 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 24 Jun 2013 06:33:11 +0000 (08:33 +0200)
The next libusb release will deprecate libusb_get_port_path, and since
we compile with -Werror, this breaks the build.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/host-libusb.c

index 3a582c526dd2c2dcf66531f681da9f24bfc30504..0c12b0fddde7807d3fe24472c12a7b5eb71aa2fb 100644 (file)
@@ -241,7 +241,11 @@ static int usb_host_get_port(libusb_device *dev, char *port, size_t len)
     size_t off;
     int rc, i;
 
+#if LIBUSBX_API_VERSION >= 0x01000102
+    rc = libusb_get_port_numbers(dev, path, 7);
+#else
     rc = libusb_get_port_path(ctx, dev, path, 7);
+#endif
     if (rc < 0) {
         return 0;
     }