X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=macro.h;h=622c08eeda89ef840f06ac24638ae01873d13469;hp=2379ee2de3cc6114dff85e2c454049a5b0b5ec37;hb=05a602f468a4f00d36ee7da73f13c0b014786fea;hpb=185986c61d4f84efcc02cc5766c77e876654a0a9 diff --git a/macro.h b/macro.h index 2379ee2de..622c08eed 100644 --- a/macro.h +++ b/macro.h @@ -117,10 +117,12 @@ static inline size_t ALIGN(size_t l) { #define char_array_0(x) x[sizeof(x)-1] = 0; -#define IOVEC_SET_STRING(iovec, s) \ +#define IOVEC_SET_STRING(i, s) \ do { \ - (iovec).iov_base = s; \ - (iovec).iov_len = strlen(s); \ + struct iovec *_i = &(i); \ + char *_s = (char *)(s); \ + _i->iov_base = _s; \ + _i->iov_len = strlen(_s); \ } while(false); #include "log.h"