diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2020-01-20 23:54:37 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2020-01-22 13:16:17 +0400 |
commit | d8e3c6030b729f581f382e0e7f9334b776ae0982 (patch) | |
tree | 6da735f11df3e22e2541cb7a09103a7565742dd3 | |
parent | 14ec36e107a8c9af7d0a80c3571fe39b291ff1d4 (diff) | |
download | slirp-d8e3c6030b729f581f382e0e7f9334b776ae0982.zip slirp-d8e3c6030b729f581f382e0e7f9334b776ae0982.tar.gz slirp-d8e3c6030b729f581f382e0e7f9334b776ae0982.tar.bz2 |
util: add G_SIZEOF_MEMBER() macro
I am (overly?) optimistic this macro will be added to glib:
https://gitlab.gnome.org/GNOME/glib/merge_requests/1333
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-rw-r--r-- | src/util.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -61,6 +61,10 @@ }) #endif +#ifndef G_SIZEOF_MEMBER +#define G_SIZEOF_MEMBER(type, member) sizeof(((type *)0)->member) +#endif + #if defined(_WIN32) /* CONFIG_IOVEC */ #if !defined(IOV_MAX) /* XXX: to avoid duplicate with QEMU osdep.h */ struct iovec { |