From patchwork Tue Oct 27 14:51:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 536681 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 37C0F1402B6 for ; Wed, 28 Oct 2015 01:55:04 +1100 (AEDT) Received: from localhost ([::1]:60241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr5eQ-0002A0-8E for incoming@patchwork.ozlabs.org; Tue, 27 Oct 2015 10:55:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr5ax-0005lp-5J for qemu-devel@nongnu.org; Tue, 27 Oct 2015 10:51:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zr5at-0004fw-V7 for qemu-devel@nongnu.org; Tue, 27 Oct 2015 10:51:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr5at-0004fl-Q2 for qemu-devel@nongnu.org; Tue, 27 Oct 2015 10:51:23 -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 533738E235 for ; Tue, 27 Oct 2015 14:51:23 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-42.ams2.redhat.com [10.36.116.42]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9REpL3J014766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 27 Oct 2015 10:51:22 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 258E8303F916; Tue, 27 Oct 2015 15:51:21 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 27 Oct 2015 15:51:21 +0100 Message-Id: <1445957481-21059-1-git-send-email-armbru@redhat.com> In-Reply-To: <1444921716-9511-1-git-send-email-armbru@redhat.com> References: <1444921716-9511-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: amit.shah@redhat.com, marcandre.lureau@redhat.com Subject: [Qemu-devel] [PATCH 4.5/7] glib: add compatibility interface for g_hash_table_add() 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 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..5185630 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 { \