macro: introduce DEFINE_TRIVIAL_DESTRUCTOR() macro

This commit is contained in:
Yu Watanabe
2018-12-02 06:21:11 +01:00
parent deae09ccc5
commit 1e26b1dfc7
+5
View File
@@ -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) \