From: Guy Harris Date: Sun, 28 Jan 2018 07:52:27 +0000 (-0800) Subject: Only define struct addrinfo in some cases. X-Git-Tag: libpcap-1.9-bp~263 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/e117237cf3726e54a502098170e7ed599799254a Only define struct addrinfo in some cases. Define it only if: _WIN32 is defined; INET6 is defined; __MINGW32__ and DEFINE_ADDITIONAL_IPV6_STUFF are defined. --- diff --git a/gencode.c b/gencode.c index 487e8477..766e9d1e 100644 --- a/gencode.c +++ b/gencode.c @@ -113,10 +113,8 @@ struct sockaddr_in6 uint32_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ }; - #endif /* defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF) */ - #endif /* INET6 */ - #ifndef EAI_ADDRFAMILY + #ifndef EAI_ADDRFAMILY struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ int ai_family; /* PF_xxx */ @@ -127,7 +125,9 @@ struct addrinfo { struct sockaddr *ai_addr; /* binary address */ struct addrinfo *ai_next; /* next structure in linked list */ }; - #endif /* EAI_ADDRFAMILY */ + #endif /* EAI_ADDRFAMILY */ + #endif /* defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF) */ + #endif /* INET6 */ #else /* _WIN32 */ #include /* for "struct addrinfo" */ #endif /* _WIN32 */