X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=macro.h;h=2eaa3d6fbbdadbf5075a99d825423a815ff08e6a;hp=76ae465b90f2754a7b001be9617a9a8e7386ee76;hb=2fa086a8e02b1b2d62a9a424b41944f3a2251e60;hpb=e2c76839a3f6444072ae452605204c7113ffdc37 diff --git a/macro.h b/macro.h index 76ae465b9..2eaa3d6fb 100644 --- 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