dect
/
libpcap
Archived
13
0
Fork 0

Added a bunch of #ifdef directives to make wpcap.dll (WinPcap) compile under cygwin.

cygwin finally ships with ws2tcpip.h, so we need to get rid of some duplicated definitions.
This commit is contained in:
test 2009-07-16 15:46:55 -07:00
parent 7adb5eda4b
commit 04740b6647
3 changed files with 30 additions and 6 deletions

View File

@ -90,6 +90,29 @@ extern struct hostent *getipnodebyaddr (const void *, size_t, int, int *);
extern struct hostent *getipnodebyname (const char *, int, int, int *);
extern int inet_pton (int, const char *, void *);
extern const char *inet_ntop (int, const void *, char *, size_t);
#else
#ifndef EAI_BADHINTS
#define EAI_BADHINTS 12
#endif
#ifndef EAI_PROTOCOL
#define EAI_PROTOCOL 13
#endif
#ifndef EAI_MAX
#define EAI_MAX 14
#endif
#ifndef NETDB_INTERNAL
#define NETDB_INTERNAL -1 /* see errno */
#endif
#ifndef AI_MASK
/* valid flags for addrinfo */
#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
#endif
#endif /* HAVE_ADDRINFO */
/*
@ -120,3 +143,4 @@ extern const char *inet_ntop (int, const void *, char *, size_t);
#ifndef NI_DGRAM
#define NI_DGRAM 0x00000010
#endif

View File

@ -27,9 +27,7 @@
#include <winsock2.h>
#ifndef __MINGW32__
#include <ws2tcpip.h>
#endif /* __MINGW32__ */
#ifndef __MINGW32__
#define IN_MULTICAST(a) IN_CLASSD(a)
@ -39,7 +37,7 @@
#define IN_LOOPBACKNET 127
#ifdef __MINGW32__
#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)
/* IPv6 address */
struct in6_addr
{
@ -60,12 +58,12 @@ struct in6_addr
#endif /* __MINGW32__ */
#if (defined WIN32) || (defined __MINGW32__)
#if (defined _MSC_VER) || (defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF))
typedef unsigned short sa_family_t;
#endif
#ifdef __MINGW32__
#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)
#define __SOCKADDR_COMMON(sa_prefix) \
sa_family_t sa_prefix##family
@ -149,7 +147,7 @@ struct sockaddr_in6
#define IP6OPT_MUTABLE 0x20
#ifdef __MINGW32__
#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)
#ifndef EAI_ADDRFAMILY
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */

View File

@ -252,6 +252,7 @@ do { \
#define MATCH(x, y, w) \
((x) == (y) || ((w) && ((x) == ANY || (y) == ANY)))
#if defined(DEFINE_ADDITIONAL_IPV6_STUFF)
char *
gai_strerror(ecode)
int ecode;
@ -260,6 +261,7 @@ gai_strerror(ecode)
ecode = EAI_MAX;
return ai_errlist[ecode];
}
#endif
void
freeaddrinfo(ai)