diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-03-03 15:41:58 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-03-03 15:41:58 +0000 |
| commit | 62e1cbd0c03839e0623da962feee356cb9b633d9 (patch) | |
| tree | 86913021da024f0b4f651fdb093f9d906b26a720 /src | |
| parent | 55552adb9350d698a762cf40615f9b943a6580df (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
Diffstat (limited to 'src')
| -rw-r--r-- | src/DHTRoutingTableDeserializer.cc | 2 | ||||
| -rw-r--r-- | src/DHTRoutingTableSerializer.cc | 2 | ||||
| -rw-r--r-- | src/DownloadEngine.h | 2 | ||||
| -rw-r--r-- | src/Platform.cc | 4 | ||||
| -rw-r--r-- | src/Platform.h | 4 | ||||
| -rw-r--r-- | src/SocketCore.h | 2 | ||||
| -rw-r--r-- | src/a2netcompat.h | 21 | ||||
| -rw-r--r-- | src/common.h | 4 | ||||
| -rw-r--r-- | src/gai_strerror.h | 4 | ||||
| -rw-r--r-- | src/getaddrinfo.h | 4 | ||||
| -rw-r--r-- | src/gettimeofday.h | 4 | ||||
| -rw-r--r-- | src/inet_aton.h | 4 | ||||
| -rw-r--r-- | src/timegm.h | 4 |
13 files changed, 57 insertions, 4 deletions
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 |
