From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZroFa-0004iB-GD for qemu-devel@nongnu.org; Thu, 29 Oct 2015 10:32:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZroFX-0001Cc-Q9 for qemu-devel@nongnu.org; Thu, 29 Oct 2015 10:32:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZroFX-0001CI-Km for qemu-devel@nongnu.org; Thu, 29 Oct 2015 10:32:19 -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 60265C0A5251 for ; Thu, 29 Oct 2015 14:32:19 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9TEWHb7025393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 29 Oct 2015 10:32:18 -0400 From: Markus Armbruster Date: Thu, 29 Oct 2015 15:32:11 +0100 Message-Id: <1446129134-26379-12-git-send-email-armbru@redhat.com> In-Reply-To: <1446129134-26379-1-git-send-email-armbru@redhat.com> References: <1446129134-26379-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PULL v3 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/glib-compat.h b/include/glib-compat.h index fb25f43..e75dd96 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -165,6 +165,14 @@ static inline GThread *g_thread_new(const char *name, #define CompatGCond GCond #endif /* glib 2.31 */ +#if !GLIB_CHECK_VERSION(2, 32, 0) +/* Beware, function returns gboolean since 2.39.2, see GLib commit 9101915 */ +static inline void g_hash_table_add(GHashTable *hash_table, gpointer key) +{ + g_hash_table_replace(hash_table, key, key) +} +#endif + #ifndef g_assert_true #define g_assert_true(expr) \ do { \ -- 2.4.3