mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
use offsetof directly
This commit is contained in:
parent
7a2d752118
commit
5b485c699c
1 changed files with 5 additions and 3 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
* top-level directory of the distribution.
|
* top-level directory of the distribution.
|
||||||
*/
|
*/
|
||||||
/* stolen from FreeBSD for use in OpenLDAP */
|
/* stolen from FreeBSD for use in OpenLDAP */
|
||||||
|
/* $OpenLDAP$ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1991, 1993
|
* Copyright (c) 1991, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
|
|
@ -48,8 +49,6 @@
|
||||||
#ifndef _SYS_QUEUE_H_
|
#ifndef _SYS_QUEUE_H_
|
||||||
#define _SYS_QUEUE_H_
|
#define _SYS_QUEUE_H_
|
||||||
|
|
||||||
#define __offsetof offsetof
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file defines five types of data structures: singly-linked lists,
|
* This file defines five types of data structures: singly-linked lists,
|
||||||
* singly-linked tail queues, lists, tail queues, and circular queues.
|
* singly-linked tail queues, lists, tail queues, and circular queues.
|
||||||
|
|
@ -119,6 +118,9 @@
|
||||||
* _REMOVE + + + + +
|
* _REMOVE + + + + +
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
|
* see queue(3) for instructions on how to use
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Singly-linked List definitions.
|
* Singly-linked List definitions.
|
||||||
|
|
@ -212,7 +214,7 @@ struct { \
|
||||||
(STAILQ_EMPTY(head) ? \
|
(STAILQ_EMPTY(head) ? \
|
||||||
NULL : \
|
NULL : \
|
||||||
((struct type *) \
|
((struct type *) \
|
||||||
((char *)((head)->stqh_last) - __offsetof(struct type, field))))
|
((char *)((head)->stqh_last) - offsetof(struct type, field))))
|
||||||
|
|
||||||
#define STAILQ_FOREACH(var, head, field) \
|
#define STAILQ_FOREACH(var, head, field) \
|
||||||
for((var) = (head)->stqh_first; (var); (var) = (var)->field.stqe_next)
|
for((var) = (head)->stqh_first; (var); (var) = (var)->field.stqe_next)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue