]> The Tcpdump Group git mirrors - libpcap/commitdiff
Only define struct addrinfo in some cases.
authorGuy Harris <[email protected]>
Sun, 28 Jan 2018 07:52:27 +0000 (23:52 -0800)
committerGuy Harris <[email protected]>
Sun, 28 Jan 2018 07:52:27 +0000 (23:52 -0800)
Define it only if:

_WIN32 is defined;

INET6 is defined;

__MINGW32__ and DEFINE_ADDITIONAL_IPV6_STUFF are defined.

gencode.c

index 487e8477ec47f2b48b5f0c7ce185b2b75980ebc9..766e9d1e8c25275e4357145c120647b7ef15b662 100644 (file)
--- 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 <netdb.h>   /* for "struct addrinfo" */
 #endif /* _WIN32 */