aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGianluca Varenni <gianluca.varenni@gmail.com>2010-10-15 01:42:59 -0700
committerGianluca Varenni <gianluca.varenni@gmail.com>2010-10-15 01:42:59 -0700
commitcc1a80e41edebdf636deb1df98d3b2640407e3b3 (patch)
tree415620391a77f90841333d5931968ef7badfbfa9
parent4d7214cbc5dcc8e9635f99c13367dea37eddda0f (diff)
Fixes to compile WinPcap under MINGW32 and MINGW64.
-rw-r--r--Win32/Src/getaddrinfo.c11
-rw-r--r--gencode.c2
-rw-r--r--inet.c6
-rw-r--r--pcap-win32.c7
-rw-r--r--pcap.c2
-rw-r--r--scanner.l2
6 files changed, 23 insertions, 7 deletions
diff --git a/Win32/Src/getaddrinfo.c b/Win32/Src/getaddrinfo.c
index 8e8ad85d..ebfe8c2c 100644
--- a/Win32/Src/getaddrinfo.c
+++ b/Win32/Src/getaddrinfo.c
@@ -45,6 +45,12 @@
* in ai_flags?
*/
+/*
+ * Mingw64 has its own implementation of getaddrinfo, mingw32 no
+ */
+#ifndef __MINGW64__
+
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -85,7 +91,7 @@ static const char rcsid[] _U_ =
#ifdef NEED_ADDRINFO_H
#include "addrinfo.h"
#ifdef WIN32
-#include "IP6_misc.h"
+#include "ip6_misc.h"
#endif
#endif
@@ -1118,3 +1124,6 @@ find_afd(af)
}
return NULL;
}
+
+
+#endif /*__MING64__*/
diff --git a/gencode.c b/gencode.c
index f66492ef..b94ea729 100644
--- a/gencode.c
+++ b/gencode.c
@@ -47,7 +47,7 @@ static const char rcsid[] _U_ =
* XXX - why was this included even on UNIX?
*/
#ifdef __MINGW32__
-#include "IP6_misc.h"
+#include "ip6_misc.h"
#endif
#ifndef WIN32
diff --git a/inet.c b/inet.c
index 178eb81f..5bdae11f 100644
--- a/inet.c
+++ b/inet.c
@@ -878,8 +878,10 @@ pcap_lookupdev(errbuf)
*/
while(NAdapts--)
{
- strcpy((char*)tUstr, tAstr);
- (char*)tUstr += strlen(tAstr) + 1;;
+ char* tmp = (char*)tUstr;
+ strcpy(tmp, tAstr);
+ tmp += strlen(tAstr) + 1;
+ tUstr = (WCHAR*)tmp;
tAstr += strlen(tAstr) + 1;
}
diff --git a/pcap-win32.c b/pcap-win32.c
index 0e2201e3..0e11ed5d 100644
--- a/pcap-win32.c
+++ b/pcap-win32.c
@@ -39,7 +39,12 @@ static const char rcsid[] _U_ =
#include <pcap-int.h>
#include <Packet32.h>
#ifdef __MINGW32__
-#include <ddk/ndis.h>
+#ifdef __MINGW64__
+#include <ntddndis.h>
+#else /*__MINGW64__*/
+#include <ddk/ntddndis.h>
+#include <ndis.h>
+#endif /*__MINGW64__*/
#else /*__MINGW32__*/
#include <ntddndis.h>
#endif /*__MINGW32__*/
diff --git a/pcap.c b/pcap.c
index 4b64a38d..91a62e45 100644
--- a/pcap.c
+++ b/pcap.c
@@ -57,7 +57,7 @@ static const char rcsid[] _U_ =
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__MINGW32__)
#include <unistd.h>
#endif
#include <fcntl.h>
diff --git a/scanner.l b/scanner.l
index a061a7e9..c8e2d200 100644
--- a/scanner.l
+++ b/scanner.l
@@ -54,7 +54,7 @@ static const char rcsid[] _U_ =
#include <pcap-stdinc.h>
#ifdef __MINGW32__
-#include "IP6_misc.h"
+#include "ip6_misc.h"
#endif
#else /* WIN32 */
#include <sys/socket.h> /* for "struct sockaddr" in "struct addrinfo" */