diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-05-13 16:33:01 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-05-28 22:09:00 +0200 |
commit | a066eb6ca7537d03aec51b4fc5e39b3a556b46f5 (patch) | |
tree | ff69d9598efb38877ddde567f3289f92256135dd | |
parent | ff0694bbdd7222a9daf47ef45ffaad70e290463c (diff) | |
download | slirp-a066eb6ca7537d03aec51b4fc5e39b3a556b46f5.zip slirp-a066eb6ca7537d03aec51b4fc5e39b3a556b46f5.tar.gz slirp-a066eb6ca7537d03aec51b4fc5e39b3a556b46f5.tar.bz2 |
container_of: avoid using __extension__
We can just write the macro on one line.
-rw-r--r-- | src/util.h | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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 |