util: fix container_of on MSVC
otherwise &container_of(..)->foo won't work, need extra parens. gcc version is fine. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38313>
This commit is contained in:
committed by
Marge Bot
parent
a0b8ee614d
commit
583b25e806
+1
-1
@@ -103,7 +103,7 @@
|
||||
#ifndef __GNUC__
|
||||
/* a grown-up compiler is required for the extra type checking: */
|
||||
# define container_of(ptr, type, member) \
|
||||
(type*)((uint8_t *)ptr - offsetof(type, member))
|
||||
((type*)((uint8_t *)ptr - offsetof(type, member)))
|
||||
#else
|
||||
# define __same_type(a, b) \
|
||||
__builtin_types_compatible_p(__typeof__(a), __typeof__(b))
|
||||
|
||||
Reference in New Issue
Block a user