From patchwork Tue Jan 24 09:39:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 9535125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 919E66042D for ; Tue, 24 Jan 2017 12:36:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84B5626E4D for ; Tue, 24 Jan 2017 12:36:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79ACE27F81; Tue, 24 Jan 2017 12:36:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 51FC626E4D for ; Tue, 24 Jan 2017 12:36:11 +0000 (UTC) Received: from localhost ([::1]:48400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cW0KY-00034M-9e for patchwork-qemu-devel@patchwork.kernel.org; Tue, 24 Jan 2017 07:36:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVzqF-0000fO-QN for qemu-devel@nongnu.org; Tue, 24 Jan 2017 07:04:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVzqC-00006E-IN for qemu-devel@nongnu.org; Tue, 24 Jan 2017 07:04:51 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:35700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVzqC-00005P-B9; Tue, 24 Jan 2017 07:04:48 -0500 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C96D942105; Tue, 24 Jan 2017 15:04:47 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id 22EA557C; Tue, 24 Jan 2017 12:39:44 +0300 (MSK) Received: (nullmailer pid 12657 invoked by uid 1000); Tue, 24 Jan 2017 09:39:41 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Tue, 24 Jan 2017 12:39:28 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 24/31] win32: use glib gpoll if glib >= 2.50 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Michael Tokarev Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Marc-André Lureau A fix has been committed in upstream glib commit 210a9796f78eb90f76f1bd6a304e9fea05e97617. (See also related bug https://bugzilla.gnome.org/show_bug.cgi?id=764415) It is desirable to use the glib version instead of qemu copy, since it provides more debugging facilities (G_MAIN_POLL_DEBUG etc), and hopefully has a better maintainance. Hopefully, we can drop the qemu copy in a few years. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrange Reviewed-by: Stefan Weil Signed-off-by: Michael Tokarev --- include/glib-compat.h | 2 +- util/oslib-win32.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/glib-compat.h b/include/glib-compat.h index acf254d..0cd24ff 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -39,7 +39,7 @@ static inline gint64 qemu_g_get_monotonic_time(void) #define g_get_monotonic_time() qemu_g_get_monotonic_time() #endif -#ifdef _WIN32 +#if defined(_WIN32) && !GLIB_CHECK_VERSION(2, 50, 0) /* * g_poll has a problem on Windows when using * timeouts < 10ms, so use wrapper. diff --git a/util/oslib-win32.c b/util/oslib-win32.c index d09863c..0b1890f 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -327,6 +327,7 @@ char *qemu_get_exec_dir(void) return g_strdup(exec_dir); } +#if !GLIB_CHECK_VERSION(2, 50, 0) /* * The original implementation of g_poll from glib has a problem on Windows * when using timeouts < 10 ms. @@ -530,6 +531,7 @@ gint g_poll(GPollFD *fds, guint nfds, gint timeout) return retval; } +#endif int getpagesize(void) {