diff options
author | phk <phk@FreeBSD.org> | 2000-10-22 19:43:01 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-10-22 19:43:01 +0000 |
commit | 7db5793b7f5fa7716616953eab087fd10f0a2fe4 (patch) | |
tree | ea076593557c7ae1c90684927d5629eb08323b57 /sys | |
parent | f6d29697e120dfa64b93e94751cd6806c703a219 (diff) | |
download | FreeBSD-src-7db5793b7f5fa7716616953eab087fd10f0a2fe4.zip FreeBSD-src-7db5793b7f5fa7716616953eab087fd10f0a2fe4.tar.gz |
Don't bogusly include <struct.h>
Bogusly define our own versions of strbase() and fldoff() until we
have sorted out where they live in the kernel.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/queue.h | 16 |
1 files changed, 13 insertions, 3 deletions
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 <struct.h> - /* * 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) |