diff options
| author | Michael Biebl <biebl@debian.org> | 2020-10-05 22:28:16 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2020-10-05 22:28:16 +0200 |
| commit | 47a2114d6f697a31d84c8874c49e94dd04119d75 (patch) | |
| tree | e3022686ff1956d7f17f1f7cdf7022ce980b7a5c /shared/systemd/src/basic/list.h | |
| parent | 9d722f3d3492e31c0b3e4bcba603ffd65309c621 (diff) | |
| parent | aafc1dbe4712c86189bbc1d4d54ad8cb4c69be7e (diff) | |
Update upstream source from tag 'upstream/1.27.90'
Update to upstream version '1.27.90' with Debian dir 72a0791efa5966be1724a82dfcac90f6cd22bd1b
Diffstat (limited to 'shared/systemd/src/basic/list.h')
| -rw-r--r-- | shared/systemd/src/basic/list.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/shared/systemd/src/basic/list.h b/shared/systemd/src/basic/list.h index f7f97000..b62c3749 100644 --- a/shared/systemd/src/basic/list.h +++ b/shared/systemd/src/basic/list.h @@ -169,3 +169,18 @@ #define LIST_IS_EMPTY(head) \ (!(head)) + +/* Join two lists tail to head: a->b, c->d to a->b->c->d and de-initialise second list */ +#define LIST_JOIN(name,a,b) \ + do { \ + assert(b); \ + if (!(a)) \ + (a) = (b); \ + else { \ + typeof(*(a)) *_head = (b), *_tail; \ + LIST_FIND_TAIL(name, (a), _tail); \ + _tail->name##_next = _head; \ + _head->name##_prev = _tail; \ + } \ + (b) = NULL; \ + } while (false) |