usb: fix usb-host build on windows.
PATCH 1/1 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 <[email protected]>
Signed-off-by Gerd Hoffmann <[email protected]>
--- hw/usb/host-libusb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/usb/host-libusb.c +2 -2
@@ -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;
Signature · 1 line
2.18.4
Quoted 34 lines · Gerd Hoffmann
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 <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>--- hw/usb/host-libusb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/usb/host-libusb.c +1
-1@@ -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);hw/usb/host-libusb.c +1
-1@@ -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;
Quoted 4 lines
--
2.18.4Thanks for the quick fix, so:
Tested-by Howard Spoelstra <[email protected]>
Quoted 25 lines · Gerd Hoffmann
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 <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>--- hw/usb/host-libusb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/usb/host-libusb.c +1
-1@@ -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);
hw/usb/host-libusb.c static void usb_host_realize(USBDevice *udev, Error **errp) · line 1113
Quoted 8 lines
hw/usb/host-libusb.c +1
-1@@ -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;
Reviewed-by Philippe Mathieu-Daudé <[email protected]>