mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-19 08:00:32 +01:00
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. (cherry picked from commitedfe9fa9a2) (cherry picked from commit6936a0613c) (cherry picked from commite333a28b97)
This commit is contained in:
parent
9ed8b871bb
commit
2283cd98f9
1 changed files with 9 additions and 3 deletions
|
|
@ -411,9 +411,8 @@ _nm_g_hash_table_get_keys_as_array (GHashTable *hash_table,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
#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;
|
||||
|
|
@ -423,13 +422,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))
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue