Received: from eggs.gnu.org ([2001:4830:134:3::10]:41758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agHsl-0005qK-Bf for qemu-devel@nongnu.org; Wed, 16 Mar 2016 16:17:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agHsi-0007uS-5d for qemu-devel@nongnu.org; Wed, 16 Mar 2016 16:17:27 -0400 Received: from qemu.weilnetz.de ([37.221.198.45]:60100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agHsh-0007u5-VX for qemu-devel@nongnu.org; Wed, 16 Mar 2016 16:17:24 -0400 From: Stefan Weil Date: Wed, 16 Mar 2016 21:17:19 +0100 Message-Id: <1458159439-32322-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH] usb: Fix compilation for Windows List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developer Cc: Stefan Weil , Gerd Hoffmann Mingw-w64 does not provide sys/ioctl.h and Linux builds don't need it, so remove that include statement. ERROR is defined by wingdi.h (included via windows.h). Undefine it before it is redefined to avoid a compiler warning / error. Signed-off-by: Stefan Weil --- Cygwin now includes Mingw-w64 packages for cross compilation. The packages mingw64-x86_64-libusb1.0 and mingw64-x86_64-usbredir can be used for QEMU builds, but trigger new compiler errors. This patch fixes them partially. Regards, Stefan hw/usb/redirect.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 38a5393..cbcc218 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -34,12 +34,14 @@ #include "qemu/iov.h" #include "sysemu/char.h" -#include #include #include #include "hw/usb.h" +/* ERROR is defined below. Remove any previous definition. */ +#undef ERROR + #define MAX_ENDPOINTS 32 #define NO_INTERFACE_INFO 255 /* Valid interface_count always <= 32 */ #define EP2I(ep_address) (((ep_address & 0x80) >> 3) | (ep_address & 0x0f)) -- 2.1.4