tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

On 22 Nov, 2013, at 03:49 , Rhialto <> wrote:
> I was thinking of something like this, which breaks the API because the
> current TAILQ_PREV takes 'headname' and not 'type' as a parameter:
> #defined TAILQ_PREV(elm, type, field) \
>    (char *)(elm->field.tqe_prev) - offsetof(struct type, field)

This doesn't work, unfortunately.  Consider what happens when
elm is at the head of the list.

Dennis Ferguson

Home | Main Index | Thread Index | Old Index