projects
/
NetworkManager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a50d28d
)
shared: add nm_unauto() helper macro
author
Thomas Haller
<thaller@redhat.com>
Fri, 11 Mar 2016 12:38:30 +0000
(13:38 +0100)
committer
Thomas Haller
<thaller@redhat.com>
Thu, 17 Mar 2016 14:00:48 +0000
(15:00 +0100)
shared/nm-macros-internal.h
patch
|
blob
|
history
diff --git
a/shared/nm-macros-internal.h
b/shared/nm-macros-internal.h
index
1eedadd
..
e875392
100644
(file)
--- a/
shared/nm-macros-internal.h
+++ b/
shared/nm-macros-internal.h
@@
-315,6
+315,18
@@
_notify (obj_type *obj, _PropertyEnums prop) \
/*****************************************************************************/
+#define nm_unauto(pp) \
+ ({ \
+ G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \
+ gpointer *_pp = (gpointer *) (pp); \
+ gpointer _p = *_pp; \
+ \
+ *_pp = NULL; \
+ _p; \
+ })
+
+/*****************************************************************************/
+
static inline gpointer
nm_g_object_ref (gpointer obj)
{