From a066eb6ca7537d03aec51b4fc5e39b3a556b46f5 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 13 May 2022 16:33:01 +0200 Subject: container_of: avoid using __extension__ We can just write the macro on one line. --- src/util.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/util.h b/src/util.h index 07654ec..49a1cd9 100644 --- a/src/util.h +++ b/src/util.h @@ -57,11 +57,8 @@ #endif #ifndef container_of -#define container_of(ptr, type, member) \ - __extension__({ \ - void *__mptr = (void *)(ptr); \ - ((type *)(__mptr - offsetof(type, member))); \ - }) +#define container_of(ptr, type, member) \ + ((type *) (((char *)(ptr)) - offsetof(type, member))) #endif #ifndef G_SIZEOF_MEMBER -- cgit v1.1