From c7ba9e25b30fc86fc996412ae988bf7d4c47a7ba Mon Sep 17 00:00:00 2001 From: Ulf Lamping Date: Sat, 24 Mar 2007 18:26:34 +0000 Subject: hmmm, _WINSOCK2API_ is not the way to go, the PSDK that comes with MSVC 6.0 also defines this - but not sockaddr_storage :-( Next try is to use the WINVER #define. AFAIK, this depends on the Platform SDK version used, which is actually our problem here. So this fix *might* work ... svn path=/trunk/; revision=21168 --- capture_wpcap_packet.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'capture_wpcap_packet.c') diff --git a/capture_wpcap_packet.c b/capture_wpcap_packet.c index e7a458d88c..714d8434fc 100644 --- a/capture_wpcap_packet.c +++ b/capture_wpcap_packet.c @@ -44,10 +44,14 @@ -#ifndef HAVE_SOCKADDR_STORAGE -/* packet32.h requires sockaddr_storage (usually defined in Platform SDK) +/* packet32.h requires sockaddr_storage + * wether sockaddr_storage is defined or not depends on the Platform SDK + * version installed. The only one not defining it is the SDK that comes + * with MSVC 6.0 (WINVER 0x0400). + * * copied from RFC2553 (and slightly modified because of datatypes) ... * XXX - defined more than once, move this to a header file */ +#if (WINVER <= 0x0400) typedef unsigned short eth_sa_family_t; /* @@ -63,10 +67,6 @@ typedef unsigned short eth_sa_family_t; #define ETH_SS_PAD2SIZE (ETH_SS_MAXSIZE - (sizeof (eth_sa_family_t) + \ ETH_SS_PAD1SIZE + ETH_SS_ALIGNSIZE)) -/* sockaddr_storage seems to depend if a Platform SDK is installed, - (or to be more precise, if WINSOCK2 is available) - and not on the MSVC version installed */ -#if defined _WIN32 && !defined _WINSOCK2API_ struct sockaddr_storage { eth_sa_family_t __ss_family; /* address family */ /* Following fields are implementation specific */ @@ -82,8 +82,7 @@ struct sockaddr_storage { /* __ss_pad1, __ss_align fields is 112 */ }; /* ... copied from RFC2553 */ -#endif /* _WIN32 */ -#endif /* HAVE_SOCKADDR_STORAGE */ +#endif /* WINVER */ #include -- cgit v1.2.3