mirror of
https://github.com/bellard/quickjs.git
synced 2025-09-30 15:04:24 +03:00
added container_of macro
This commit is contained in:
3
list.h
3
list.h
@@ -36,8 +36,7 @@ struct list_head {
|
||||
#define LIST_HEAD_INIT(el) { &(el), &(el) }
|
||||
|
||||
/* return the pointer of type 'type *' containing 'el' as field 'member' */
|
||||
#define list_entry(el, type, member) \
|
||||
((type *)((uint8_t *)(el) - offsetof(type, member)))
|
||||
#define list_entry(el, type, member) container_of(el, type, member)
|
||||
|
||||
static inline void init_list_head(struct list_head *head)
|
||||
{
|
||||
|
Reference in New Issue
Block a user