From 1ad04320ca5cf0ae0b2868db176414cccb13c814 Mon Sep 17 00:00:00 2001 From: "hyunghwan.chung" Date: Wed, 27 Jun 2018 15:57:39 +0000 Subject: [PATCH] fixed a compilation issue in moo_sck_addr_len() --- moo/mod/sck-addr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moo/mod/sck-addr.c b/moo/mod/sck-addr.c index 1ac49ca..9729602 100644 --- a/moo/mod/sck-addr.c +++ b/moo/mod/sck-addr.c @@ -544,19 +544,19 @@ sck_len_t moo_sck_addr_len (sck_addr_t* addr) { switch (addr->family) { - #if defined(AF_INET) + #if defined(AF_INET) && (MOO__SIZEOF_STRUCT_SOCKADDR_IN > 0) case AF_INET: return MOO_SIZEOF(struct sockaddr_in); #endif - #if defined(AF_INET6) + #if defined(AF_INET6) && (MOO_SIZEOF_STRUCT_SOCKADDR_IN6 > 0) case AF_INET6: return MOO_SIZEOF(struct sockaddr_in6); #endif - #if defined(AF_PACKET) + #if defined(AF_PACKET) && (MOO_SIZEOF_STRUCT_SOCKADDR_LL > 0) case AF_PACKET: return MOO_SIZEOF(struct sockaddr_ll); #endif - #if defined(AF_UNIX) + #if defined(AF_UNIX) && (MOO_SIZEOF_STRUCT_SOCKADDR_UN > 0) case AF_UNIX: return MOO_SIZEOF(struct sockaddr_un); #endif