mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-24 04:20:32 +01:00
shared/nm-glib: add our own g_steal_pointer() macro to shadow the one from glib
g_steal_pointer() as provided by glib improved significantly. Nowadays it
casts the return type via the non-standard typeof() operator.
But this useful feature is only enabled with
GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_58
which NetworkManager does not set.
This macro is hardly rocket science. Always provide our own
implementation, that always does the casting (we rely on gcc/clang
to support typeof() already at many places).
This commit is contained in:
parent
a13b2397de
commit
6c07faa013
1 changed files with 6 additions and 4 deletions
|
|
@ -424,12 +424,14 @@ g_steal_pointer (gpointer pp)
|
|||
|
||||
return ref;
|
||||
}
|
||||
|
||||
/* type safety */
|
||||
#define g_steal_pointer(pp) \
|
||||
(0 ? (*(pp)) : (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))
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue