Skip to content

Commit

Permalink
[BZ #5779]
Browse files Browse the repository at this point in the history
	* misc/sys/queue.h: Add STAILQ_CONCAT and TAILQ_CONCAT definitions.
	Patch by Roy Marples <roy@marples.name>.
  • Loading branch information
Ulrich Drepper committed Mar 5, 2008
1 parent 1560068 commit a4bb445
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
2008-03-04 Ulrich Drepper <drepper@redhat.com>

[BZ #5779]
* misc/sys/queue.h: Add STAILQ_CONCAT and TAILQ_CONCAT definitions.
Patch by Roy Marples <roy@marples.name>.

[BZ #5736]
* malloc/malloc.c: Fix typo in comment.

Expand Down
17 changes: 17 additions & 0 deletions misc/sys/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ struct { \
(var); \
(var) = ((var)->field.stqe_next))

#define STAILQ_CONCAT(head1, head2) do { \
if (!STAILQ_EMPTY((head2))) { \
*(head1)->stqh_last = (head2)->stqh_first; \
(head1)->stqh_last = (head2)->stqh_last; \
STAILQ_INIT((head2)); \
} \
} while (/*CONSTCOND*/0)

/*
* Singly-linked Tail queue access methods.
*/
Expand Down Expand Up @@ -434,6 +442,15 @@ struct { \
(var); \
(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))

#define TAILQ_CONCAT(head1, head2, field) do { \
if (!TAILQ_EMPTY(head2)) { \
*(head1)->tqh_last = (head2)->tqh_first; \
(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
(head1)->tqh_last = (head2)->tqh_last; \
TAILQ_INIT((head2)); \
} \
} while (/*CONSTCOND*/0)

/*
* Tail queue access methods.
*/
Expand Down

0 comments on commit a4bb445

Please sign in to comment.