qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL v3 11/14] glib: add compatibility interface for g_has


From: Markus Armbruster
Subject: [Qemu-devel] [PULL v3 11/14] glib: add compatibility interface for g_hash_table_add()
Date: Thu, 29 Oct 2015 15:32:11 +0100

The next commit will use it.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]