hmmm, _WINSOCK2API_ is not the way to go, the PSDK that comes with MSVC 6.0 also...
[obnox/wireshark/wip.git] / capture_wpcap_packet.c
index e7a458d88cef7474b14946538fc5483f9088650a..714d8434fcc8161d9003bbb96b42b0c0a235d32c 100644 (file)
 
 
 
-#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 <Packet32.h>