chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
macro: introduce _cleanup_free_ macro for automatic freeing of scoped vars and make...
[elogind.git]
/
src
/
shared
/
macro.h
diff --git
a/src/shared/macro.h
b/src/shared/macro.h
index 4595750394d8a2a5d43c68d27d46eb0d1ec55a64..df17617b1ebc9c2ccd16533574cf284feca1632a 100644
(file)
--- a/
src/shared/macro.h
+++ b/
src/shared/macro.h
@@
-187,4
+187,7
@@
static inline size_t IOVEC_INCREMENT(struct iovec *i, unsigned n, size_t k) {
return k;
}
+#define _cleanup_free_ __attribute__((cleanup(freep)))
+#define _cleanup_fclose_ __attribute__((cleanup(fclosep)))
+
#include "log.h"