usb: fix usb-host build on windows.
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 24 Jun 2020 13:45:10 +0000 (15:45 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 13 Jul 2020 09:46:51 +0000 (11:46 +0200)
Seems the new API is not available on windows.
Update #ifdefs accordingly.

Fixes: 9f815e83e983 ("usb: add hostdevice property to usb-host")
Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>
Message-id: 20200624134510.9381-1-kraxel@redhat.com

hw/usb/host-libusb.c

index ad7ed8fb0c67f48c91f16549f5a43faa6350efc5..c474551d8456c7fa33275b9c1cb31bd0708fa7ee 100644 (file)
@@ -907,7 +907,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
             goto fail;
         }
     } else {
-#if LIBUSB_API_VERSION >= 0x01000107
+#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
         trace_usb_host_open_hostfd(hostfd);
 
         rc = libusb_wrap_sys_device(ctx, hostfd, &s->dh);
@@ -1107,7 +1107,7 @@ static void usb_host_realize(USBDevice *udev, Error **errp)
     QTAILQ_INIT(&s->isorings);
     s->hostfd = -1;
 
-#if LIBUSB_API_VERSION >= 0x01000107
+#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
     if (s->hostdevice) {
         int fd;
         s->needs_autoscan = false;
This page took 0.032009 seconds and 4 git commands to generate.