提交 631009e7 编写于 作者: G Gerd Hoffmann

usb: fix usb-host build on windows.

Seems the new API is not available on windows.
Update #ifdefs accordingly.

Fixes: 9f815e83 ("usb: add hostdevice property to usb-host")
Reported-by: NHoward Spoelstra <hsp.cat7@gmail.com>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: NHoward Spoelstra <hsp.cat7@gmail.com>
Message-id: 20200624134510.9381-1-kraxel@redhat.com
上级 18595181
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册