[network-manager-applet] glib: avoid deprecation warning of g_steal_pointer()



commit da47a6d1471cfcc1fab607d62f402017308e6a35
Author: Thomas Haller <thaller redhat com>
Date:   Tue Feb 2 17:52:47 2021 +0100

    glib: avoid deprecation warning of g_steal_pointer()
    
    We have a compat implementation to cope with older glib versions.
    The warning is not useful to us.
    
       error: ‘g_steal_pointer’ is deprecated: Not available before 2.44 [-Werror=deprecated-declarations]

 shared/nm-utils/nm-glib.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/shared/nm-utils/nm-glib.h b/shared/nm-utils/nm-glib.h
index 2a5e0904..1e8d97b6 100644
--- a/shared/nm-utils/nm-glib.h
+++ b/shared/nm-utils/nm-glib.h
@@ -378,9 +378,12 @@ _nm_g_hash_table_get_keys_as_array (GHashTable *hash_table,
                                __VA_ARGS__)
 #endif
 
-#if !GLIB_CHECK_VERSION(2, 44, 0)
+#if defined(g_steal_pointer)
+#undef g_steal_pointer
+#endif
+
 static inline gpointer
-g_steal_pointer (gpointer pp)
+_g_steal_pointer (gpointer pp)
 {
        gpointer *ptr = (gpointer *) pp;
        gpointer ref;
@@ -391,10 +394,8 @@ g_steal_pointer (gpointer pp)
        return ref;
 }
 
-/* type safety */
 #define g_steal_pointer(pp) \
-  (0 ? (*(pp)) : (g_steal_pointer) (pp))
-#endif
+  (0 ? (*(pp)) : (_g_steal_pointer) (pp))
 
 
 static inline gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]