aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-06-24 15:45:10 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-07-13 11:46:51 +0200
commit631009e775a91018a62e2670b4473e99916f858f (patch)
tree37c630e4528b0281b1562d04060e60ec0bcfa88b /hw/usb
parent185951817dede3dfe4eb1c4c6d262607bee605ef (diff)
downloadqemu-631009e775a91018a62e2670b4473e99916f858f.zip
qemu-631009e775a91018a62e2670b4473e99916f858f.tar.gz
qemu-631009e775a91018a62e2670b4473e99916f858f.tar.bz2
usb: fix usb-host build on windows.
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
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/host-libusb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index ad7ed8f..c474551 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -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;