From patchwork Wed Mar 16 20:22:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 8604541 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 45E3C9F6E1 for ; Wed, 16 Mar 2016 20:22:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A8964202F2 for ; Wed, 16 Mar 2016 20:22:25 +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 D82D520225 for ; Wed, 16 Mar 2016 20:22:24 +0000 (UTC) Received: from localhost ([::1]:58641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agHxY-0000Kj-6G for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 Mar 2016 16:22:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agHxR-0000Kd-1t for qemu-devel@nongnu.org; Wed, 16 Mar 2016 16:22:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agHxN-00028k-S8 for qemu-devel@nongnu.org; Wed, 16 Mar 2016 16:22:16 -0400 Received: from qemu.weilnetz.de ([37.221.198.45]:60111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agHxN-00028b-Ly for qemu-devel@nongnu.org; Wed, 16 Mar 2016 16:22:13 -0400 Received: by qemu.weilnetz.de (Postfix, from userid 1000) id 7A81517F6A3; Wed, 16 Mar 2016 21:22:10 +0100 (CET) From: Stefan Weil To: QEMU Developer Date: Wed, 16 Mar 2016 21:22:09 +0100 Message-Id: <1458159729-683-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: Support compilation without poll.h 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 This is a hack to support compilation with Mingw-w64 which provides a libusb-1.0 package, but no poll.h. Signed-off-by: Stefan Weil --- I did not test whether this USB host code works on Windows, but at least it compiles with this hack. Suggestions for a better fix are welcome. Regards, Stefan hw/usb/host-libusb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 5e7ec45..139028e 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -34,7 +34,9 @@ */ #include "qemu/osdep.h" +#ifdef CONFIG_PPOLL #include +#endif #include #include "qemu-common.h" @@ -203,18 +205,24 @@ static const char *err_names[] = { static libusb_context *ctx; static uint32_t loglevel; +#ifdef CONFIG_PPOLL static void usb_host_handle_fd(void *opaque) { struct timeval tv = { 0, 0 }; libusb_handle_events_timeout(ctx, &tv); } +#endif static void usb_host_add_fd(int fd, short events, void *user_data) { +#ifdef CONFIG_PPOLL qemu_set_fd_handler(fd, (events & POLLIN) ? usb_host_handle_fd : NULL, (events & POLLOUT) ? usb_host_handle_fd : NULL, ctx); +#else + g_assert(events == 0); +#endif } static void usb_host_del_fd(int fd, void *user_data)