2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2015 Michael Jeanson <mjeanson@efficios.com>
7 #ifndef _BABELTRACE_COMPAT_GLIB_H
8 #define _BABELTRACE_COMPAT_GLIB_H
12 #if GLIB_CHECK_VERSION(2,31,8)
14 static inline gboolean
15 bt_g_hash_table_contains(GHashTable
*hash_table
, gconstpointer key
)
17 return g_hash_table_contains(hash_table
, key
);
22 static inline gboolean
23 bt_g_hash_table_contains(GHashTable
*hash_table
, gconstpointer key
)
28 return g_hash_table_lookup_extended(hash_table
, key
, &orig_key
,
35 #if GLIB_CHECK_VERSION(2,29,16)
37 static inline GPtrArray
*
38 bt_g_ptr_array_new_full(guint reserved_size
,
39 GDestroyNotify element_free_func
)
41 return g_ptr_array_new_full(reserved_size
, element_free_func
);
46 static inline GPtrArray
*
47 bt_g_ptr_array_new_full(guint reserved_size
,
48 GDestroyNotify element_free_func
)
52 array
= g_ptr_array_sized_new(reserved_size
);
56 g_ptr_array_set_free_func(array
, element_free_func
);
62 #endif /* _BABELTRACE_COMPAT_GLIB_H */