chiark / gitweb /
Move DEFINE_TRIVIAL_CLEANUP_FUNC to macro.h
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 18 Jan 2015 04:20:00 +0000 (23:20 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 19 Jan 2015 00:06:48 +0000 (19:06 -0500)
This remove the need for various header files to include the
(relatively heavyweight) util.h.

src/console/consoled.h
src/import/import-raw.h
src/journal/journal-file.h
src/shared/macro.h
src/shared/set.h
src/shared/util.h

index f8a3df4487d1e06fcf50baec678316a60eec230a..b0db610400bd28f892a0f3180c42dcf35b090008 100644 (file)
@@ -26,7 +26,6 @@
 #include <libudev.h>
 #include <stdlib.h>
 #include "grdev.h"
-#include "hashmap.h"
 #include "idev.h"
 #include "list.h"
 #include "macro.h"
@@ -36,7 +35,6 @@
 #include "sysview.h"
 #include "term.h"
 #include "unifont.h"
-#include "util.h"
 
 typedef struct Manager Manager;
 typedef struct Session Session;
index 5a38cdcc9e58c91889f07b42bbf801393ef81828..a423ec0187a181559069bf6ef8963c5c477787e1 100644 (file)
@@ -20,7 +20,7 @@
 ***/
 
 #include "sd-event.h"
-#include "util.h"
+#include "macro.h"
 
 typedef struct RawImport RawImport;
 
index 6812385e1ef63f3767089705a6ee800f1b4428b4..2526e14d650f3ab7cec8599d84b72e285bf8a9e0 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "sparse-endian.h"
 #include "journal-def.h"
-#include "util.h"
+#include "macro.h"
 #include "mmap-cache.h"
 #include "hashmap.h"
 
index daa42c4c68101ce5e70fb773a7fafd5937c417e8..96d96f962116d0fdcce5c264a57e1c874c0d5fbe 100644 (file)
@@ -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"
index 4605ecd2c17caedb7465ea22b8ec265a5cb6d5bc..2b49e2f2870fefdc2191ed7f2321fcbb1a73e579 100644 (file)
@@ -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)
index 5818fee82e52f48be4bdd9c1fdea8c0ee5f169a9..8a3e95a17aa11d55ed13e26e0d110264dde341c0 100644 (file)
@@ -664,13 +664,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);
 }