From patchwork Mon Feb 3 13:31:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 316149 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 519CE2C0089 for ; Tue, 4 Feb 2014 00:32:39 +1100 (EST) Received: from localhost ([::1]:47078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAJdd-00019w-6Z for incoming@patchwork.ozlabs.org; Mon, 03 Feb 2014 08:32:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAJd8-000169-JT for qemu-devel@nongnu.org; Mon, 03 Feb 2014 08:32:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAJd2-0004X4-K3 for qemu-devel@nongnu.org; Mon, 03 Feb 2014 08:32:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAJd2-0004Wy-AL for qemu-devel@nongnu.org; Mon, 03 Feb 2014 08:32:00 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s13DVvxr005234 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Feb 2014 08:31:57 -0500 Received: from localhost (ovpn-112-21.ams2.redhat.com [10.36.112.21]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s13DVtG6002161; Mon, 3 Feb 2014 08:31:57 -0500 From: Stefan Hajnoczi To: Date: Mon, 3 Feb 2014 14:31:48 +0100 Message-Id: <1391434310-9990-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1391434310-9990-1-git-send-email-stefanha@redhat.com> References: <1391434310-9990-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Anthony Liguori Subject: [Qemu-devel] [PATCH 1/3] glib: move g_poll() replacement into glib-compat.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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We have a dedicated header file for wrappers to smooth over glib version differences. Move the g_poll() definition into glib-compat.h for consistency. Signed-off-by: Stefan Hajnoczi --- include/glib-compat.h | 12 ++++++++++++ include/qemu-common.h | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/glib-compat.h b/include/glib-compat.h index 8aa77af..8d25900 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -24,4 +24,16 @@ static inline guint g_timeout_add_seconds(guint interval, GSourceFunc function, } #endif +#if !GLIB_CHECK_VERSION(2, 20, 0) +/* + * Glib before 2.20.0 doesn't implement g_poll, so wrap it to compile properly + * on older systems. + */ +static inline gint g_poll(GPollFD *fds, guint nfds, gint timeout) +{ + GMainContext *ctx = g_main_context_default(); + return g_main_context_get_poll_func(ctx)(fds, nfds, timeout); +} +#endif + #endif diff --git a/include/qemu-common.h b/include/qemu-common.h index 5054836..e0e03cc 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -124,18 +124,6 @@ int qemu_main(int argc, char **argv, char **envp); void qemu_get_timedate(struct tm *tm, int offset); int qemu_timedate_diff(struct tm *tm); -#if !GLIB_CHECK_VERSION(2, 20, 0) -/* - * Glib before 2.20.0 doesn't implement g_poll, so wrap it to compile properly - * on older systems. - */ -static inline gint g_poll(GPollFD *fds, guint nfds, gint timeout) -{ - GMainContext *ctx = g_main_context_default(); - return g_main_context_get_poll_func(ctx)(fds, nfds, timeout); -} -#endif - /** * is_help_option: * @s: string to test