aboutsummaryrefslogtreecommitdiff
path: root/pcap-types.h
diff options
context:
space:
mode:
Diffstat (limited to 'pcap-types.h')
-rw-r--r--pcap-types.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/pcap-types.h b/pcap-types.h
index 7c318d09..bb264c3e 100644
--- a/pcap-types.h
+++ b/pcap-types.h
@@ -34,6 +34,22 @@
/*
* Get the integer types we use defined, by hook or by crook.
*/
+#ifdef _WIN32
+/*
+ * Avoids a compiler warning in case this was already defined
+ * (someone defined _WINSOCKAPI_ when including 'windows.h', in order
+ * to prevent it from including 'winsock.h')
+ */
+#ifdef _WINSOCKAPI_
+#undef _WINSOCKAPI_
+#endif
+
+/*
+ * This defines u_int.
+ */
+#include <winsock2.h>
+#endif
+
#if defined(_MSC_VER)
/*
* Target is Windows, compiler is MSVC.
@@ -94,6 +110,9 @@
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif
+ /*
+ * This defines u_int, among other types.
+ */
#include <sys/types.h>
#endif