chiark / gitweb /
macro: move IOVEC_SET_STRING into macro.h
[elogind.git] / macro.h
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