aboutsummaryrefslogtreecommitdiff
path: root/pcap-int.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-09-14 00:18:47 -0700
committerGuy Harris <guy@alum.mit.edu>2015-09-14 00:18:47 -0700
commitecf2cf1f94791f2e2d0c3daf7a50da496b7ec34f (patch)
treec1d56de7e5b6be4a5e5f3b3ba213446d434744b6 /pcap-int.h
parent5dd09155abcc9a80ffdf49ff03e2bff5fb0aa31f (diff)
Avoid collisions between pcap/bpf.h and Packet32.h structure definitions.
In most cases, avoid Packet32.h's definition of BPF structures, which are different from pcap/bpf.h's definitions, by defining BPF_MAJOR_VERSION before including it. In the cases where we *do* need Packet32.h's definitions, define PCAP_DONT_INCLUDE_PCAP_BPF_H to make sure pcap/bpf.h doesn't get included and define them, and include <Packet32.h> before pcap-int.h, *without* BPF_MAJOR_VERSION being defined, so that it defines those structures. For pcap-win32.h, also include pcap/dlt.h, so we get the DLT_ values defined.
Diffstat (limited to 'pcap-int.h')
-rw-r--r--pcap-int.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/pcap-int.h b/pcap-int.h
index 655c19d9..8abbf254 100644
--- a/pcap-int.h
+++ b/pcap-int.h
@@ -41,6 +41,11 @@ extern "C" {
#endif
#ifdef _WIN32
+/*
+ * Make sure Packet32.h doesn't define BPF structures that we've
+ * probably already defined as a result of including <pcap/pcap.h>.
+ */
+#define BPF_MAJOR_VERSION
#include <Packet32.h>
extern CRITICAL_SECTION g_PcapCompileCriticalSection;
#endif /* _WIN32 */