Skip to content

Commit a7dd74a

Browse files
committed
sys/queue: Add definition of __containerof
In FreeBSD this is provided in <sys/cdefs.h> but we don't need to pull whole system header.
1 parent 7eb9a8e commit a7dd74a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sys/sys/include/sys/queue.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#ifndef _SYS_QUEUE_H_
3535
#define _SYS_QUEUE_H_
3636

37+
#include <os/util.h>
38+
3739
/*
3840
* This file defines four types of data structures: singly-linked lists,
3941
* singly-linked tail queues, lists and tail queues.
@@ -114,6 +116,11 @@
114116
* _SWAP + + + +
115117
*
116118
*/
119+
120+
#ifndef __containerof
121+
#define __containerof CONTAINER_OF
122+
#endif
123+
117124
#ifdef QUEUE_MACRO_DEBUG
118125
#warn Use QUEUE_MACRO_DEBUG_TRACE and/or QUEUE_MACRO_DEBUG_TRASH
119126
#define QUEUE_MACRO_DEBUG_TRACE

0 commit comments

Comments
 (0)