diff options
author | Bill Meier <wmeier@newsguy.com> | 2008-10-24 00:42:09 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2008-10-24 00:42:09 +0000 |
commit | 8afa208ffbb9ecc1b6195aef20d269e2fefd88d3 (patch) | |
tree | 9dba16a45db59ebe1b10965d38f3844a27cc911f /capture_wpcap_packet.c | |
parent | ede39bfe1fed5b6ea7949c610cffe34315266803 (diff) | |
download | wireshark-8afa208ffbb9ecc1b6195aef20d269e2fefd88d3.tar.gz wireshark-8afa208ffbb9ecc1b6195aef20d269e2fefd88d3.tar.bz2 wireshark-8afa208ffbb9ecc1b6195aef20d269e2fefd88d3.zip |
Windows build: #include winsock2.h only when needed.
#include winsock2.h pulls in about 90 distinct .h files
and about 140 total .h files.
Currently winsock2.h is (mostly unnecessarily) included
for each dissector via packet.h/wtap.h.
This patch removes #include winsock2.h from wtap.h and
then includes winsock2.h (or windows.h) in the
few specific places required.
With this patch, my Windows Wireshark build takes
about 30% less time.
svn path=/trunk/; revision=26535
Diffstat (limited to 'capture_wpcap_packet.c')
-rw-r--r-- | capture_wpcap_packet.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/capture_wpcap_packet.c b/capture_wpcap_packet.c index d26da5f8f4..6729e0c838 100644 --- a/capture_wpcap_packet.c +++ b/capture_wpcap_packet.c @@ -34,7 +34,6 @@ #include <glib.h> #include <gmodule.h> -#include <wtap.h> #include <pcap.h> /* XXX - yes, I know, I should move cppmagic.h to a generic location. */ @@ -42,15 +41,23 @@ #include <epan/value_string.h> +#include <Packet32.h> +#include <windows.h> +#include <windowsx.h> +#include <Ntddndis.h> +#include "capture_wpcap_packet.h" /* packet32.h requires sockaddr_storage - * wether sockaddr_storage is defined or not depends on the Platform SDK + * whether 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 */ +#ifndef WINVER +#error WINVER not defined .... +#endif #if (WINVER <= 0x0400) && defined(_MSC_VER) typedef unsigned short eth_sa_family_t; @@ -85,13 +92,6 @@ struct sockaddr_storage { #endif /* WINVER */ -#include <Packet32.h> -#include <windows.h> -#include <windowsx.h> -#include <Ntddndis.h> - -#include "capture_wpcap_packet.h" - gboolean has_wpacket = FALSE; |