summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/macro.h7
-rw-r--r--src/shared/set.h2
-rw-r--r--src/shared/util.h7
3 files changed, 8 insertions, 8 deletions
diff --git a/src/shared/macro.h b/src/shared/macro.h
index 41fe61fb68..6aa6d98913 100644
--- a/src/shared/macro.h
+++ b/src/shared/macro.h
@@ -241,4 +241,11 @@ static inline size_t IOVEC_INCREMENT(struct iovec *i, unsigned n, size_t k) {
#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"
diff --git a/src/shared/set.h b/src/shared/set.h
index 4605ecd2c1..2b49e2f287 100644
--- a/src/shared/set.h
+++ b/src/shared/set.h
@@ -22,7 +22,7 @@
***/
#include "hashmap.h"
-#include "util.h"
+#include "macro.h"
Set *internal_set_new(const struct hash_ops *hash_ops HASHMAP_DEBUG_PARAMS);
#define set_new(ops) internal_set_new(ops HASHMAP_DEBUG_SRC_ARGS)
diff --git a/src/shared/util.h b/src/shared/util.h
index 8b7d37d73c..c672d8dd41 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -322,13 +322,6 @@ static inline void freep(void *p) {
free(*(void**) p);
}
-#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__
-
static inline void closep(int *fd) {
safe_close(*fd);
}