aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcap-stdinc.h12
-rw-r--r--pcap-types.h19
2 files changed, 20 insertions, 11 deletions
diff --git a/pcap-stdinc.h b/pcap-stdinc.h
index 9ea1f681..28edd5d3 100644
--- a/pcap-stdinc.h
+++ b/pcap-stdinc.h
@@ -60,22 +60,12 @@
#ifndef pcap_stdinc_h
#define pcap_stdinc_h
-/*
- * 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
+#include <pcap-types.h>
-#include <winsock2.h>
#include <fcntl.h>
#include <time.h>
#include <io.h>
#include <ws2tcpip.h>
-#include <pcap-types.h>
-
#endif /* pcap_stdinc_h */
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