]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
macro: introduce DEFINE_TRIVIAL_DESTRUCTOR() macro
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 28 Nov 2018 15:32:57 +0000 (00:32 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 2 Dec 2018 05:21:11 +0000 (06:21 +0100)
src/basic/macro.h

index f54f13e4fe4fde320273049e718c9918dfbd2c5f..80a1d1abb48cca8ec71b822457b301af3d63a15f 100644 (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)                                         \