From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrLtv-0002Cv-W6 for qemu-devel@nongnu.org; Wed, 28 Oct 2015 04:16:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrLtu-0008I2-RW for qemu-devel@nongnu.org; Wed, 28 Oct 2015 04:16:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrLtu-0008Hf-Mm for qemu-devel@nongnu.org; Wed, 28 Oct 2015 04:16:06 -0400 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 (Postfix) with ESMTPS id 49C3E19CB82 for ; Wed, 28 Oct 2015 08:16:06 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-38.ams2.redhat.com [10.36.116.38]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9S8G4UZ020642 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 28 Oct 2015 04:16:05 -0400 From: Markus Armbruster Date: Wed, 28 Oct 2015 09:15:58 +0100 Message-Id: <1446020161-21758-12-git-send-email-armbru@redhat.com> In-Reply-To: <1446020161-21758-1-git-send-email-armbru@redhat.com> References: <1446020161-21758-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PULL v2 11/14] glib: add compatibility interface for g_hash_table_add() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The next commit will use it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- include/glib-compat.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/glib-compat.h b/include/glib-compat.h index fb25f43..6d13b5f 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -165,6 +165,13 @@ static inline GThread *g_thread_new(const char *name, #define CompatGCond GCond #endif /* glib 2.31 */ +#if !GLIB_CHECK_VERSION(2, 32, 0) +static inline gboolean g_hash_table_add(GHashTable *hash_table, gpointer key) +{ + return g_hash_table_replace(hash_table, key, key) +} +#endif + #ifndef g_assert_true #define g_assert_true(expr) \ do { \ -- 2.4.3