diff options
| author | Michael Biebl <biebl@debian.org> | 2016-08-03 23:00:16 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-08-03 23:00:16 +0200 |
| commit | 511e94811644318cc196e197616fdc558030e8e3 (patch) | |
| tree | 1ea5c895be190982cc686d43ebed62ae33d60426 /shared/nm-glib.h | |
| parent | fb15332b981b5637ae4aeadc546e2f46bf333cd1 (diff) | |
| parent | d6201f5d8daada3d64a0a3e0038e14eebec683ce (diff) | |
Merge tag 'upstream/1.2.4'
Upstream version 1.2.4
Diffstat (limited to 'shared/nm-glib.h')
| -rw-r--r-- | shared/nm-glib.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/shared/nm-glib.h b/shared/nm-glib.h index c92d6f0f..5f8ebc7f 100644 --- a/shared/nm-glib.h +++ b/shared/nm-glib.h @@ -374,4 +374,22 @@ _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) +{ + gpointer *ptr = (gpointer *) pp; + gpointer ref; + + ref = *ptr; + *ptr = NULL; + + return ref; +} + +/* type safety */ +#define g_steal_pointer(pp) \ + (0 ? (*(pp)) : (g_steal_pointer) (pp)) +#endif + #endif /* __NM_GLIB_H__ */ |