slirp: rewrite macro to remove void* arithmetic

This commit is contained in:
David Hrdlička
2020-12-16 20:40:22 +01:00
parent a22b9a0eb5
commit 7c76b94821

View File

@@ -59,11 +59,7 @@
#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