Skip to content

Commit 631009e

Browse files
committed
usb: fix usb-host build on windows.
Seems the new API is not available on windows. Update #ifdefs accordingly. Fixes: 9f815e8 ("usb: add hostdevice property to usb-host") Reported-by: Howard Spoelstra <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Howard Spoelstra <[email protected]> Message-id: [email protected]
1 parent 1859518 commit 631009e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hw/usb/host-libusb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev, int hostfd)
907907
goto fail;
908908
}
909909
} else {
910-
#if LIBUSB_API_VERSION >= 0x01000107
910+
#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
911911
trace_usb_host_open_hostfd(hostfd);
912912

913913
rc = libusb_wrap_sys_device(ctx, hostfd, &s->dh);
@@ -1107,7 +1107,7 @@ static void usb_host_realize(USBDevice *udev, Error **errp)
11071107
QTAILQ_INIT(&s->isorings);
11081108
s->hostfd = -1;
11091109

1110-
#if LIBUSB_API_VERSION >= 0x01000107
1110+
#if LIBUSB_API_VERSION >= 0x01000107 && !defined(CONFIG_WIN32)
11111111
if (s->hostdevice) {
11121112
int fd;
11131113
s->needs_autoscan = false;

0 commit comments

Comments
 (0)