projects
/
NetworkManager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf29d02
)
macros: add nm_auto() macro to cleanup functions
author
Thomas Haller
<thaller@redhat.com>
Sun, 28 Feb 2016 10:53:54 +0000
(11:53 +0100)
committer
Thomas Haller
<thaller@redhat.com>
Mon, 29 Feb 2016 13:08:00 +0000
(14:08 +0100)
shared/nm-macros-internal.h
patch
|
blob
|
history
diff --git
a/shared/nm-macros-internal.h
b/shared/nm-macros-internal.h
index
9971f15
..
aa38bac
100644
(file)
--- a/
shared/nm-macros-internal.h
+++ b/
shared/nm-macros-internal.h
@@
-24,12
+24,14
@@
/********************************************************/
+#define nm_auto(fcn) __attribute ((cleanup(fcn)))
+
/**
* nm_auto_free:
*
* Call free() on a variable location when it goes out of scope.
*/
-#define nm_auto_free
__attribute__ ((cleanup(_nm_auto_free_impl))
)
+#define nm_auto_free
nm_auto(_nm_auto_free_impl
)
GS_DEFINE_CLEANUP_FUNCTION(void*, _nm_auto_free_impl, free)
/********************************************************/