Markus Armbruster <[email protected]> writes:
> The next commit will use it.
>
> Signed-off-by: Markus Armbruster <[email protected]>
> Reviewed-by: Eric Blake <[email protected]>
> ---
> 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