summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-03-03 15:41:58 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-03-03 15:41:58 +0000
commit62e1cbd0c03839e0623da962feee356cb9b633d9 (patch)
tree86913021da024f0b4f651fdb093f9d906b26a720
parent55552adb9350d698a762cf40615f9b943a6580df (diff)
2008-03-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Merged Ross's mingw patch. * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableSerializer.cc * src/Platform.{h, cc} * src/timegm.h * src/gettimeofday.h * src/getaddrinfo.h * src/SocketCore.h * src/common.h * src/inet_aton.h * src/DownloadEngine.h * src/gai_strerror.h * src/a2netcompat.h * configure.ac * configure * aclocal.m4
-rw-r--r--ChangeLog19
-rw-r--r--aclocal.m46
-rwxr-xr-xconfigure10
-rw-r--r--configure.ac2
-rw-r--r--src/DHTRoutingTableDeserializer.cc2
-rw-r--r--src/DHTRoutingTableSerializer.cc2
-rw-r--r--src/DownloadEngine.h2
-rw-r--r--src/Platform.cc4
-rw-r--r--src/Platform.h4
-rw-r--r--src/SocketCore.h2
-rw-r--r--src/a2netcompat.h21
-rw-r--r--src/common.h4
-rw-r--r--src/gai_strerror.h4
-rw-r--r--src/getaddrinfo.h4
-rw-r--r--src/gettimeofday.h4
-rw-r--r--src/inet_aton.h4
-rw-r--r--src/timegm.h4
17 files changed, 85 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f75260d..b54b70b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2008-03-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
+
+ Merged Ross's mingw patch.
+ * src/DHTRoutingTableDeserializer.cc
+ * src/DHTRoutingTableSerializer.cc
+ * src/Platform.{h, cc}
+ * src/timegm.h
+ * src/gettimeofday.h
+ * src/getaddrinfo.h
+ * src/SocketCore.h
+ * src/common.h
+ * src/inet_aton.h
+ * src/DownloadEngine.h
+ * src/gai_strerror.h
+ * src/a2netcompat.h
+ * configure.ac
+ * configure
+ * aclocal.m4
+
2008-03-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Included missing iostream.
diff --git a/aclocal.m4 b/aclocal.m4
index 6ca63f2b..914ac071 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -180,7 +180,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
fi
fi
if test $ok = yes; then
- AC_MSG_RESULT(yes)
+ AC_MSG_RESULT([yes ($libgcrypt_config_version)])
else
AC_MSG_RESULT(no)
fi
@@ -192,10 +192,10 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
if test "$tmp" -gt 0 ; then
AC_MSG_CHECKING([LIBGCRYPT API version])
if test "$req_libgcrypt_api" -eq "$tmp" ; then
- AC_MSG_RESULT(okay)
+ AC_MSG_RESULT([okay])
else
ok=no
- AC_MSG_RESULT([does not match (want=$req_libgcrypt_api got=$tmp)])
+ AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
fi
fi
fi
diff --git a/configure b/configure
index 5f1b2a2d..f7fc506f 100755
--- a/configure
+++ b/configure
@@ -2633,7 +2633,7 @@ ac_config_headers="$ac_config_headers config.h"
case "$target" in
*mingw*|*cygwin*)
- WINSOCK_LIBS="-lws2_32"
+ WINSOCK_LIBS="-lws2_32 -lpthread"
;;
esac
@@ -6220,8 +6220,8 @@ echo $ECHO_N "checking for LIBGCRYPT - version >= $min_libgcrypt_version... $ECH
fi
fi
if test $ok = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { echo "$as_me:$LINENO: result: yes ($libgcrypt_config_version)" >&5
+echo "${ECHO_T}yes ($libgcrypt_config_version)" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
@@ -6239,8 +6239,8 @@ echo $ECHO_N "checking LIBGCRYPT API version... $ECHO_C" >&6; }
echo "${ECHO_T}okay" >&6; }
else
ok=no
- { echo "$as_me:$LINENO: result: does not match (want=$req_libgcrypt_api got=$tmp)" >&5
-echo "${ECHO_T}does not match (want=$req_libgcrypt_api got=$tmp)" >&6; }
+ { echo "$as_me:$LINENO: result: does not match. want=$req_libgcrypt_api got=$tmp" >&5
+echo "${ECHO_T}does not match. want=$req_libgcrypt_api got=$tmp" >&6; }
fi
fi
fi
diff --git a/configure.ac b/configure.ac
index 9e5002ee..ae8b651d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@ AC_CONFIG_HEADERS([config.h])
case "$target" in
*mingw*|*cygwin*)
- WINSOCK_LIBS="-lws2_32"
+ WINSOCK_LIBS="-lws2_32 -lpthread"
AC_SUBST(WINSOCK_LIBS)
;;
esac
diff --git a/src/DHTRoutingTableDeserializer.cc b/src/DHTRoutingTableDeserializer.cc
index fd84b0aa..65392451 100644
--- a/src/DHTRoutingTableDeserializer.cc
+++ b/src/DHTRoutingTableDeserializer.cc
@@ -38,7 +38,7 @@
#include "PeerMessageUtil.h"
#include "DlAbortEx.h"
#include "Logger.h"
-#include <arpa/inet.h>
+#include "a2netcompat.h"
#include <cerrno>
#include <cstring>
#include <istream>
diff --git a/src/DHTRoutingTableSerializer.cc b/src/DHTRoutingTableSerializer.cc
index 0ff64e8b..19772a8c 100644
--- a/src/DHTRoutingTableSerializer.cc
+++ b/src/DHTRoutingTableSerializer.cc
@@ -38,7 +38,7 @@
#include "DHTConstants.h"
#include "PeerMessageUtil.h"
#include "Logger.h"
-#include <arpa/inet.h>
+#include "a2netcompat.h"
#include <cerrno>
#include <cstring>
#include <ostream>
diff --git a/src/DownloadEngine.h b/src/DownloadEngine.h
index fc3c074a..7ba80c42 100644
--- a/src/DownloadEngine.h
+++ b/src/DownloadEngine.h
@@ -39,7 +39,7 @@
#include "SharedHandle.h"
#include "Command.h"
#include <deque>
-#include <sys/select.h>
+#include "a2netcompat.h"
namespace aria2 {
diff --git a/src/Platform.cc b/src/Platform.cc
index fec2d9b5..5b6ff6ff 100644
--- a/src/Platform.cc
+++ b/src/Platform.cc
@@ -49,6 +49,8 @@
#include <stdlib.h> /* _fmode */
#include <fcntl.h> /* _O_BINARY */
+namespace aria2 {
+
Platform::Platform() {
unsigned int _CRT_fmode = _O_BINARY;
WSADATA wsaData;
@@ -62,4 +64,6 @@ Platform::~Platform() {
WSACleanup();
}
+} // namespace aria2
+
#endif // HAVE_WINSOCK2_H
diff --git a/src/Platform.h b/src/Platform.h
index b53385e5..5d55061a 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -37,6 +37,8 @@
#include "common.h"
+namespace aria2 {
+
#ifdef HAVE_WINSOCK2_H
class Platform {
@@ -48,4 +50,6 @@ public:
#endif // HAVE_WINSOCK2_H
+} // namespace aria2
+
#endif // _D_PLATFORM_H_
diff --git a/src/SocketCore.h b/src/SocketCore.h
index 774ccab3..d0431472 100644
--- a/src/SocketCore.h
+++ b/src/SocketCore.h
@@ -36,7 +36,7 @@
#define _D_SOCKET_CORE_H_
#include "common.h"
-#include <sys/socket.h>
+#include "a2netcompat.h"
#include <string>
#include <utility>
diff --git a/src/a2netcompat.h b/src/a2netcompat.h
index f7915436..f811b1d7 100644
--- a/src/a2netcompat.h
+++ b/src/a2netcompat.h
@@ -91,4 +91,25 @@
# include "gai_strerror.h"
#endif // HAVE_GAI_STRERROR
+#ifdef __MINGW32__
+# ifndef AI_PASSIVE
+# define AI_PASSIVE 0x0020
+# endif // AI_PASSIVE
+# ifndef AI_NUMERICHOST
+# define AI_NUMERICHOST 0x0008
+# endif // AI_NUMERICHOST
+# ifndef NI_NUMERICHOST
+# define NI_NUMERICHOST 0x0008
+# endif // NI_NUMERICHOST
+# ifndef NI_NUMERICSERV
+# define NI_NUMERICSERV 0x0020
+# endif // NI_NUMERICSERV
+# ifndef NI_MAXHOST
+# define NI_MAXHOST 1025
+# endif // NI_MAXHOST
+# ifndef NI_MAXSERV
+# define NI_MAXSERV 32
+# endif // NI_MAXSERV
+#endif // __MINGW32__
+
#endif // _D_A2NETCOMPAT_H_
diff --git a/src/common.h b/src/common.h
index b24e3adc..56a7346c 100644
--- a/src/common.h
+++ b/src/common.h
@@ -35,6 +35,10 @@
#ifndef _D_COMMON_H_
#define _D_COMMON_H_
+#ifdef __MINGW32__
+# undef SIZE_MAX
+#endif // __MINGW32__
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
diff --git a/src/gai_strerror.h b/src/gai_strerror.h
index 5272ae57..8723f722 100644
--- a/src/gai_strerror.h
+++ b/src/gai_strerror.h
@@ -33,6 +33,10 @@
extern "C" {
#endif /* __cplusplus */
+#ifdef __MINGW32__
+# undef SIZE_MAX
+#endif // __MINGW32__
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif // HAVE_CONFIG_H
diff --git a/src/getaddrinfo.h b/src/getaddrinfo.h
index 12a2eee5..5a48c8e8 100644
--- a/src/getaddrinfo.h
+++ b/src/getaddrinfo.h
@@ -33,6 +33,10 @@
extern "C" {
#endif /* __cplusplus */
+#ifdef __MINGW32__
+# undef SIZE_MAX
+#endif // __MINGW32__
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif // HAVE_CONFIG_H
diff --git a/src/gettimeofday.h b/src/gettimeofday.h
index a503b3c8..3ce51bd9 100644
--- a/src/gettimeofday.h
+++ b/src/gettimeofday.h
@@ -36,6 +36,10 @@
#ifndef _D_GETTIMEOFDAY_H
#define _D_GETTIMEOFDAY_H 1
+#ifdef __MINGW32__
+# undef SIZE_MAX
+#endif // __MINGW32__
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif // HAVE_CONFIG_H
diff --git a/src/inet_aton.h b/src/inet_aton.h
index 5a22e815..68a0065f 100644
--- a/src/inet_aton.h
+++ b/src/inet_aton.h
@@ -40,6 +40,10 @@
extern "C" {
#endif /* __cplusplus */
+#ifdef __MINGW32__
+# undef SIZE_MAX
+#endif // __MINGW32__
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif // HAVE_CONFIG_H
diff --git a/src/timegm.h b/src/timegm.h
index c2ac28c9..1c0ecd35 100644
--- a/src/timegm.h
+++ b/src/timegm.h
@@ -34,6 +34,10 @@
#ifndef _D_TIMEGM_H_
#define _D_TIMEGM_H_
+#ifdef __MINGW32__
+# undef SIZE_MAX
+#endif // __MINGW32__
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif // HAVE_CONFIG_H