From: Yu Watanabe Date: Wed, 28 Nov 2018 15:32:57 +0000 (+0900) Subject: macro: introduce DEFINE_TRIVIAL_DESTRUCTOR() macro X-Git-Tag: v240~152^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e26b1dfc7a8d8bd5818b740e147a1f89cb50b64;p=thirdparty%2Fsystemd.git macro: introduce DEFINE_TRIVIAL_DESTRUCTOR() macro --- diff --git a/src/basic/macro.h b/src/basic/macro.h index f54f13e4fe4..80a1d1abb48 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) \