diff options
author | hwspeedy <ns@bigbear.dk> | 2024-02-16 01:14:17 +0100 |
---|---|---|
committer | hwspeedy <ns@bigbear.dk> | 2024-02-16 01:14:17 +0100 |
commit | 0ce19608f1b7ba6e280d5969cbb1a4990af86365 (patch) | |
tree | 37efcdd43c41a78297920853e012e23a4e39eea3 | |
parent | 354d8d38f978a12f7333861c62322ab17fb4bd68 (diff) |
FIX stealpointers for GLIB<2.44
-rw-r--r-- | hardinfo2/util.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/hardinfo2/util.c b/hardinfo2/util.c index e12963c0..e573e63e 100644 --- a/hardinfo2/util.c +++ b/hardinfo2/util.c @@ -943,6 +943,22 @@ GSList *modules_get_list() return modules_list; } +//Compatibility +#if GLIB_CHECK_VERSION(2,44,0) +#else +static inline gpointer +g2_steal_pointer (gpointer pp) +{ + gpointer *ptr = (gpointer *) pp; + gpointer ref; + + ref = *ptr; + *ptr = NULL; + + return ref; +} +#endif + static GSList *modules_load(gchar ** module_list) { GDir *dir; @@ -975,8 +991,9 @@ static GSList *modules_load(gchar ** module_list) filenames = g_list_delete_link(filenames, item); } #if GLIB_CHECK_VERSION(2,44,0) - //FIXME change this to not use g_steal_pointer g_list_free_full (g_steal_pointer (&filenames), g_object_unref); +#else + g_list_free_full (g2_steal_pointer (&filenames), g_object_unref); #endif g_dir_close(dir); } |