mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 07:30:10 +01:00
macros: add nm_auto() macro to cleanup functions
This commit is contained in:
parent
bf29d02ac1
commit
3a81c0f301
1 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
/********************************************************/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue