From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK9Uq-0004d2-W5 for qemu-devel@nongnu.org; Mon, 25 Mar 2013 11:39:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UK9Mn-0003UG-GZ for qemu-devel@nongnu.org; Mon, 25 Mar 2013 11:31:22 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:34732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UK9Gl-0001HT-OZ for qemu-devel@nongnu.org; Mon, 25 Mar 2013 11:25:08 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Mar 2013 01:19:47 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 081282CE804A for ; Tue, 26 Mar 2013 02:25:02 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2PFOvpl48169024 for ; Tue, 26 Mar 2013 02:24:57 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2PFP1Zr026108 for ; Tue, 26 Mar 2013 02:25:01 +1100 From: Anthony Liguori Date: Mon, 25 Mar 2013 10:24:58 -0500 Message-Id: <1364225098-13712-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH] glib: add a compatibility interface for g_timeout_add_seconds List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Stefan Hajnoczi Signed-off-by: Anthony Liguori --- include/glib-compat.h | 27 +++++++++++++++++++++++++++ include/qemu-common.h | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 include/glib-compat.h diff --git a/include/glib-compat.h b/include/glib-compat.h new file mode 100644 index 0000000..8aa77af --- /dev/null +++ b/include/glib-compat.h @@ -0,0 +1,27 @@ +/* + * GLIB Compatibility Functions + * + * Copyright IBM, Corp. 2013 + * + * Authors: + * Anthony Liguori + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_GLIB_COMPAT_H +#define QEMU_GLIB_COMPAT_H + +#include + +#if !GLIB_CHECK_VERSION(2, 14, 0) +static inline guint g_timeout_add_seconds(guint interval, GSourceFunc function, + gpointer data) +{ + return g_timeout_add(interval * 1000, function, data); +} +#endif + +#endif diff --git a/include/qemu-common.h b/include/qemu-common.h index 7754ee2..2371132 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -40,7 +40,7 @@ #include #include #include -#include +#include "glib-compat.h" #ifdef _WIN32 #include "sysemu/os-win32.h" -- 1.8.0