macros: add nm_auto() macro to cleanup functions
authorThomas Haller <thaller@redhat.com>
Sun, 28 Feb 2016 10:53:54 +0000 (11:53 +0100)
committerThomas Haller <thaller@redhat.com>
Mon, 29 Feb 2016 13:08:00 +0000 (14:08 +0100)
shared/nm-macros-internal.h

index 9971f15..aa38bac 100644 (file)
 
 /********************************************************/
 
+#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)
 
 /********************************************************/