From patchwork Wed Mar 16 20:17:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 8604391 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6A1819F6E1 for ; Wed, 16 Mar 2016 20:17:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2C4620306 for ; Wed, 16 Mar 2016 20:17:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E35120225 for ; Wed, 16 Mar 2016 20:17:35 +0000 (UTC) Received: from localhost ([::1]:58621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agHss-0005rG-IN for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 Mar 2016 16:17:34 -0400 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 Received: by qemu.weilnetz.de (Postfix, from userid 1000) id 1439117F6A3; Wed, 16 Mar 2016 21:17:21 +0100 (CET) From: Stefan Weil To: QEMU Developer Date: Wed, 16 Mar 2016 21:17:19 +0100 Message-Id: <1458159439-32322-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 37.221.198.45 Cc: Stefan Weil , Gerd Hoffmann Subject: [Qemu-devel] [PATCH] usb: Fix compilation for Windows X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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))