mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
include: drop obsolete check for typeof operator
It really seems that compilers on all our supported platforms (including Solaris) supporting `typeof`, so we can always use it and drop hacks with undefind behaviour entirely. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1432>
This commit is contained in:
committed by
Marge Bot
parent
17db4ba3de
commit
86d0f6dafa
@@ -274,19 +274,8 @@ xorg_list_is_empty(struct xorg_list *head)
|
||||
#define xorg_list_last_entry(ptr, type, member) \
|
||||
xorg_list_entry((ptr)->prev, type, member)
|
||||
|
||||
#ifdef HAVE_TYPEOF
|
||||
#define __container_of(ptr, sample, member) \
|
||||
container_of(ptr, typeof(*sample), member)
|
||||
#else
|
||||
/* This implementation of __container_of has undefined behavior according
|
||||
* to the C standard, but it works in many cases. If your compiler doesn't
|
||||
* support typeof() and fails with this implementation, please try a newer
|
||||
* compiler.
|
||||
*/
|
||||
#define __container_of(ptr, sample, member) \
|
||||
(void *)((char *)(ptr) \
|
||||
- ((char *)&(sample)->member - (char *)(sample)))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loop through the list given by head and set pos to struct in the list.
|
||||
|
||||
Reference in New Issue
Block a user