aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-05-13 16:33:01 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-05-28 22:09:00 +0200
commita066eb6ca7537d03aec51b4fc5e39b3a556b46f5 (patch)
treeff69d9598efb38877ddde567f3289f92256135dd
parentff0694bbdd7222a9daf47ef45ffaad70e290463c (diff)
downloadslirp-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.h7
1 files 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