summaryrefslogtreecommitdiff
path: root/src/shared/macro.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/macro.h')
-rw-r--r--src/shared/macro.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shared/macro.h b/src/shared/macro.h
index daa42c4c68..96d96f9621 100644
--- a/src/shared/macro.h
+++ b/src/shared/macro.h
@@ -446,4 +446,11 @@ do { \
#define GID_INVALID ((gid_t) -1)
#define MODE_INVALID ((mode_t) -1)
+#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
+ static inline void func##p(type *p) { \
+ if (*p) \
+ func(*p); \
+ } \
+ struct __useless_struct_to_allow_trailing_semicolon__
+
#include "log.h"