[NetworkManager-openconnect/lr/gtk-4.0: 2/13] glib: always re-implement g_steal_pointer()




commit fbc9497648d439a0180431748cffc9b509257f10
Author: Thomas Haller <thaller redhat com>
Date:   Mon Jun 15 15:56:30 2020 +0200

    glib: always re-implement g_steal_pointer()
    
    g_steal_pointer() is marked as GLIB_AVAILABLE_STATIC_INLINE_IN_2_44,
    that means we get a deprecated warning. Avoid that. We anyway
    re-implement the macro so that we can use it before 2.44 and so
    that it always does the typeof() cast.
    
    (imported from NetworkManager commit edfe9fa9a23422b54438c49588562b0838d80908)

 shared/nm-utils/nm-glib.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/shared/nm-utils/nm-glib.h b/shared/nm-utils/nm-glib.h
index d57e87c..04cee25 100644
--- a/shared/nm-utils/nm-glib.h
+++ b/shared/nm-utils/nm-glib.h
@@ -376,9 +376,8 @@ _nm_g_hash_table_get_keys_as_array (GHashTable *hash_table,
                                __VA_ARGS__)
 #endif
 
-#if !GLIB_CHECK_VERSION(2, 44, 0)
 static inline gpointer
-g_steal_pointer (gpointer pp)
+_nm_g_steal_pointer (gpointer pp)
 {
        gpointer *ptr = (gpointer *) pp;
        gpointer ref;
@@ -388,13 +387,20 @@ g_steal_pointer (gpointer pp)
 
        return ref;
 }
+
+#if !GLIB_CHECK_VERSION(2, 44, 0)
+static inline gpointer
+g_steal_pointer (gpointer pp)
+{
+       return _nm_g_steal_pointer (pp);
+}
 #endif
 
 #ifdef g_steal_pointer
 #undef g_steal_pointer
 #endif
 #define g_steal_pointer(pp) \
-       ((typeof (*(pp))) g_steal_pointer (pp))
+       ((typeof (*(pp))) _nm_g_steal_pointer (pp))
 
 
 static inline gboolean


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