Add and use G_SIZEOF_MEMBER() macro

A convenient macro present in the Linux kernel, named FIELD_SIZE() there.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau
2020-01-20 16:41:34 +04:00
parent fda1c651d5
commit fd61a21ecd
6 changed files with 28 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ enum
};
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX sizeof (((struct sockaddr_un *) 0)->sun_path)
#define UNIX_PATH_MAX G_SIZEOF_MEMBER (struct sockaddr_un, sun_path)
#endif
struct _GUnixSocketAddressPrivate