[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL v2 11/14] glib: add compatibility interface for g
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PULL v2 11/14] glib: add compatibility interface for g_hash_table_add() |
Date: |
Thu, 29 Oct 2015 14:39:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Markus Armbruster <address@hidden> writes:
> The next commit will use it.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---
> 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
- [Qemu-devel] [PULL v2 08/14] monitor: Simplify event throttling, (continued)
- [Qemu-devel] [PULL v2 08/14] monitor: Simplify event throttling, Markus Armbruster, 2015/10/28
- [Qemu-devel] [PULL v2 06/14] qstring: Make conversion from QObject * accept null, Markus Armbruster, 2015/10/28
- [Qemu-devel] [PULL v2 05/14] qlist: Make conversion from QObject * accept null, Markus Armbruster, 2015/10/28
- [Qemu-devel] [PULL v2 03/14] qdict: Make conversion from QObject * accept null, Markus Armbruster, 2015/10/28
- [Qemu-devel] [PULL v2 09/14] monitor: Switch from timer_new() to timer_new_ns(), Markus Armbruster, 2015/10/28
- [Qemu-devel] [PULL v2 14/14] docs: Document QMP event rate limiting, Markus Armbruster, 2015/10/28
- [Qemu-devel] [PULL v2 10/14] monitor: Split MonitorQAPIEventConf off MonitorQAPIEventState, Markus Armbruster, 2015/10/28
- [Qemu-devel] [PULL v2 07/14] monitor: Reduce casting of QAPI event QDict, Markus Armbruster, 2015/10/28
- [Qemu-devel] [PULL v2 02/14] qbool: Make conversion from QObject * accept null, Markus Armbruster, 2015/10/28
- [Qemu-devel] [PULL v2 11/14] glib: add compatibility interface for g_hash_table_add(), Markus Armbruster, 2015/10/28
- Re: [Qemu-devel] [PULL v2 11/14] glib: add compatibility interface for g_hash_table_add(),
Markus Armbruster <=
- [Qemu-devel] [PULL v2 13/14] monitor: Throttle event VSERPORT_CHANGE separately by "id", Markus Armbruster, 2015/10/28
- Re: [Qemu-devel] [PULL v2 00/14] QMP and QObject patches, Peter Maydell, 2015/10/28