summaryrefslogtreecommitdiff
path: root/src/basic/macro.h
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-11-29 00:32:57 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-12-02 06:21:11 +0100
commit1e26b1dfc7a8d8bd5818b740e147a1f89cb50b64 (patch)
treea43efd952bd7d413ffb87b976c997f661651a2ba /src/basic/macro.h
parentdeae09ccc50905747cb3a415180a833ccc8cd03b (diff)
downloadsystemd-1e26b1dfc7a8d8bd5818b740e147a1f89cb50b64.tar.gz
macro: introduce DEFINE_TRIVIAL_DESTRUCTOR() macro
Diffstat (limited to 'src/basic/macro.h')
-rw-r--r--src/basic/macro.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/macro.h b/src/basic/macro.h
index f54f13e4fe..80a1d1abb4 100644
--- a/src/basic/macro.h
+++ b/src/basic/macro.h
@@ -458,6 +458,11 @@ static inline int __coverity_check__(int condition) {
#endif
#endif
+#define DEFINE_TRIVIAL_DESTRUCTOR(name, type, func) \
+ static inline void name(type *p) { \
+ func(p); \
+ }
+
#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
static inline void func##p(type *p) { \
if (*p) \