chiark / gitweb /
macro: move IOVEC_SET_STRING into macro.h
authorLennart Poettering <lennart@poettering.net>
Tue, 6 Apr 2010 19:54:19 +0000 (21:54 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 6 Apr 2010 19:54:19 +0000 (21:54 +0200)
logger.c
macro.h

index 8ce9685..46cce5f 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -86,12 +86,6 @@ struct Stream {
         LIST_FIELDS(Stream, stream);
 };
 
-#define IOVEC_SET_STRING(iovec, s)              \
-        do {                                    \
-                (iovec).iov_base = s;           \
-                (iovec).iov_len = strlen(s);    \
-        } while(false);
-
 static int stream_log(Stream *s, char *p, usec_t timestamp) {
 
         char header_priority[16], header_time[64], header_pid[16];
diff --git a/macro.h b/macro.h
index 76ae465..2eaa3d6 100644 (file)
--- a/macro.h
+++ b/macro.h
@@ -97,4 +97,10 @@ static inline size_t ALIGN(size_t l) {
 
 #define char_array_0(x) x[sizeof(x)-1] = 0;
 
+#define IOVEC_SET_STRING(iovec, s)              \
+        do {                                    \
+                (iovec).iov_base = s;           \
+                (iovec).iov_len = strlen(s);    \
+        } while(false);
+
 #endif