Skip to contentSkip to conversation

wxx: Fix compilation of host-libusb.c

PATCH In review Stefan Weil 2 participants 2 messages Jul 29, 2016 – Aug 2, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wxx: Fix compilation of host-libusb.c

libusb.h uses the WINAPI calling convention for all function callbacks.

Cross compilation with Mingw-w64 on Cygwin fails when this calling convention is missing.

---
 hw/usb/host-libusb.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
hw/usb/host-libusb.c +4 -3
index da59c29..c632fd8 100644
@@ -358,7 +358,7 @@ static USBHostRequest *usb_host_req_find(USBHostDevice *s, USBPacket *p)
     return NULL;
 }
 
-static void usb_host_req_complete_ctrl(struct libusb_transfer *xfer)
+static void LIBUSB_CALL usb_host_req_complete_ctrl(struct libusb_transfer *xfer)
 {
     USBHostRequest *r = xfer->user_data;
     USBHostDevice  *s = r->host;
@@ -391,7 +391,7 @@ out:
     }
 }
 
-static void usb_host_req_complete_data(struct libusb_transfer *xfer)
+static void LIBUSB_CALL usb_host_req_complete_data(struct libusb_transfer *xfer)
 {
     USBHostRequest *r = xfer->user_data;
     USBHostDevice  *s = r->host;
@@ -447,7 +447,8 @@ static void usb_host_req_abort(USBHostRequest *r)
 
 /* ------------------------------------------------------------------------ */
 
-static void usb_host_req_complete_iso(struct libusb_transfer *transfer)
+static void LIBUSB_CALL
+usb_host_req_complete_iso(struct libusb_transfer *transfer)
 {
     USBHostIsoXfer *xfer = transfer->user_data;
 
Signature · 1 line
2.1.4
#1 lore raw
Quoted 5 lines · Stefan Weil

libusb.h uses the WINAPI calling convention for all function callbacks.

Cross compilation with Mingw-w64 on Cygwin fails when this calling convention is missing.

queued up both mingw fixes.

thanks,
Gerd