fixed a compilation issue in moo_sck_addr_len()

This commit is contained in:
hyunghwan.chung 2018-06-27 15:57:39 +00:00
parent b100f9a46b
commit 1ad04320ca

View File

@ -544,19 +544,19 @@ sck_len_t moo_sck_addr_len (sck_addr_t* addr)
{ {
switch (addr->family) switch (addr->family)
{ {
#if defined(AF_INET) #if defined(AF_INET) && (MOO__SIZEOF_STRUCT_SOCKADDR_IN > 0)
case AF_INET: case AF_INET:
return MOO_SIZEOF(struct sockaddr_in); return MOO_SIZEOF(struct sockaddr_in);
#endif #endif
#if defined(AF_INET6) #if defined(AF_INET6) && (MOO_SIZEOF_STRUCT_SOCKADDR_IN6 > 0)
case AF_INET6: case AF_INET6:
return MOO_SIZEOF(struct sockaddr_in6); return MOO_SIZEOF(struct sockaddr_in6);
#endif #endif
#if defined(AF_PACKET) #if defined(AF_PACKET) && (MOO_SIZEOF_STRUCT_SOCKADDR_LL > 0)
case AF_PACKET: case AF_PACKET:
return MOO_SIZEOF(struct sockaddr_ll); return MOO_SIZEOF(struct sockaddr_ll);
#endif #endif
#if defined(AF_UNIX) #if defined(AF_UNIX) && (MOO_SIZEOF_STRUCT_SOCKADDR_UN > 0)
case AF_UNIX: case AF_UNIX:
return MOO_SIZEOF(struct sockaddr_un); return MOO_SIZEOF(struct sockaddr_un);
#endif #endif