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:
Alyssa Rosenzweig
2025-11-12 12:14:21 -05:00
committed by Marge Bot
parent a0b8ee614d
commit 583b25e806
+1 -1
View File
@@ -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))