From 7db5793b7f5fa7716616953eab087fd10f0a2fe4 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 22 Oct 2000 19:43:01 +0000 Subject: Don't bogusly include Bogusly define our own versions of strbase() and fldoff() until we have sorted out where they live in the kernel. --- sys/sys/queue.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'sys/sys') diff --git a/sys/sys/queue.h b/sys/sys/queue.h index ece552b..ee66759 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -37,8 +37,6 @@ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ -#include - /* * This file defines five types of data structures: singly-linked lists, * singly-linked tail queues, lists, tail queues, and circular queues. @@ -111,6 +109,18 @@ */ /* + * XXX: temporary, we need to find the real home of these. + */ + +/* Offset of the field in the structure. */ +#define __qfldoff(name, field) \ + ((int)&(((struct name *)0)->field)) + +/* Address of the structure from a field. */ +#define __qstrbase(name, addr, field) \ + ((struct name *)((char *)(addr) - __qfldoff(name, field))) + +/* * Singly-linked List declarations. */ #define SLIST_HEAD(name, type) \ @@ -226,7 +236,7 @@ struct { \ #define STAILQ_LAST(head, type, field) \ (STAILQ_EMPTY(head) ? \ NULL : \ - strbase(type, (head)->stqh_last, field)) + __qstrbase(type, (head)->stqh_last, field)) #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) -- cgit v1.1