mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-26 23:21:11 +00:00
[libc] Use QUEUE_TYPEOF in STAILQ_LAST (#79011)
This is to ensure this macro is compatible with both C and C++.
This commit is contained in:
parent
d7fb9eb818
commit
c0a74ad90c
@ -160,7 +160,9 @@
|
||||
#define STAILQ_EMPTY(head) ((head)->first == NULL)
|
||||
#define STAILQ_FIRST(head) ((head)->first)
|
||||
#define STAILQ_LAST(head, type, field) \
|
||||
(STAILQ_EMPTY(head) ? NULL : __containerof((head)->last, type, field.next))
|
||||
(STAILQ_EMPTY(head) \
|
||||
? NULL \
|
||||
: __containerof((head)->last, QUEUE_TYPEOF(type), field.next))
|
||||
#define STAILQ_NEXT(elem, field) ((elem)->field.next)
|
||||
|
||||
#define STAILQ_FOREACH(var, head, field) \
|
||||
|
Loading…
Reference in New Issue
Block a user