Received: from eggs.gnu.org ([2001:4830:134:3::10]:43583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrnQe-0000Mb-0A for qemu-devel@nongnu.org; Thu, 29 Oct 2015 09:39:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrnQY-0004jG-US for qemu-devel@nongnu.org; Thu, 29 Oct 2015 09:39:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrnQY-0004jC-Oe for qemu-devel@nongnu.org; Thu, 29 Oct 2015 09:39:38 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 6FD56A4CC6 for ; Thu, 29 Oct 2015 13:39:38 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9TDda68019597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 29 Oct 2015 09:39:37 -0400 From: Markus Armbruster References: <1446020161-21758-1-git-send-email-armbru@redhat.com> <1446020161-21758-12-git-send-email-armbru@redhat.com> Date: Thu, 29 Oct 2015 14:39:35 +0100 In-Reply-To: <1446020161-21758-12-git-send-email-armbru@redhat.com> (Markus Armbruster's message of "Wed, 28 Oct 2015 09:15:58 +0100") Message-ID: <87ziz14wvc.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [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 Markus Armbruster writes: > 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 { \ Squashing fixup: diff --git a/include/glib-compat.h b/include/glib-compat.h index 6d13b5f..e75dd96 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -166,9 +166,10 @@ static inline GThread *g_thread_new(const char *name, #endif /* glib 2.31 */ #if !GLIB_CHECK_VERSION(2, 32, 0) -static inline gboolean g_hash_table_add(GHashTable *hash_table, gpointer key) +/* Beware, function returns gboolean since 2.39.2, see GLib commit 9101915 */ +static inline void g_hash_table_add(GHashTable *hash_table, gpointer key) { - return g_hash_table_replace(hash_table, key, key) + g_hash_table_replace(hash_table, key, key) } #endif