mirror of
https://github.com/flatpak/flatpak.git
synced 2026-10-24 08:29:34 -04:00
utils: Add backport of g_clear_handle_id to pre 2.56 glib
This commit is contained in:
1 parent
a5eebf73d2
commit
f9bf5fb5f9
1 file changed
+20
@@ -322,6 +322,26 @@ g_date_time_new_from_iso8601 (const gchar *text, GTimeZone *default_tz)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !GLIB_CHECK_VERSION (2, 56, 0)
|
||||
typedef void (* GClearHandleFunc) (guint handle_id);
|
||||
|
||||
static inline void
|
||||
g_clear_handle_id (guint *tag_ptr,
|
||||
GClearHandleFunc clear_func)
|
||||
{
|
||||
guint _handle_id;
|
||||
|
||||
_handle_id = *tag_ptr;
|
||||
if (_handle_id > 0)
|
||||
{
|
||||
*tag_ptr = 0;
|
||||
clear_func (_handle_id);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !GLIB_CHECK_VERSION (2, 58, 0)
|
||||
static inline gboolean
|
||||
g_hash_table_steal_extended (GHashTable *hash_table,
|
||||
|
||||
Reference in new issue
Block a user