Change this offsetof computation to use c89 offsetof. Tested:

This commit is contained in:
Nick Lewycky 2015-04-16 11:15:58 -07:00 committed by Fangrui Song
parent bd1e10723b
commit 0ed6ae04d6

View File

@ -40,7 +40,7 @@ struct sockaddr_un
#ifdef __USE_MISC
/* Evaluate to actual length of the `sockaddr_un' structure. */
# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
# define SUN_LEN(ptr) (offsetof(struct sockaddr_un, sun_path) \
+ strlen ((ptr)->sun_path))
#endif