summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-02-02 17:52:47 +0100
committerThomas Haller <thaller@redhat.com>2021-02-02 17:52:48 +0100
commitda47a6d1471cfcc1fab607d62f402017308e6a35 (patch)
tree3a61b4611e9c50e3e224240d0a2120db3bcc80d5
parentade0f1b7e1a29090f97a90357d0300a8d07fd932 (diff)
downloadnetwork-manager-applet-da47a6d1471cfcc1fab607d62f402017308e6a35.tar.gz
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]
-rw-r--r--shared/nm-utils/nm-glib.h11
1 files 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