slirp: rewrite macro to remove void* arithmetic
This commit is contained in:
@@ -59,11 +59,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef container_of
|
#ifndef container_of
|
||||||
#define container_of(ptr, type, member) \
|
#define container_of(ptr, type, member) ((type *)((char *)(ptr) - offsetof(type, member)));
|
||||||
__extension__({ \
|
|
||||||
void *__mptr = (void *)(ptr); \
|
|
||||||
((type *)(__mptr - offsetof(type, member))); \
|
|
||||||
})
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef G_SIZEOF_MEMBER
|
#ifndef G_SIZEOF_MEMBER
|
||||||
|
Reference in New Issue
Block a user