diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-05-15 17:22:58 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-05-15 17:22:58 +0200 |
commit | bff7c062a40379c0797c34f0f3d159e3c6126a29 (patch) | |
tree | 4d60dce275f2fd3dc5c9734edc3f3af79a18ad70 | |
parent | e3d1855bb991f7b118b77e6a2520eb4049cf5438 (diff) |
macro: interpret arguments to IOVEC_SET_STRING only once
-rw-r--r-- | macro.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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" |