oportunistic mingw fix

This commit is contained in:
Arvid Norberg 2009-06-30 23:03:54 +00:00
parent 79bc0070db
commit db165942a7
3 changed files with 7 additions and 5 deletions

View File

@ -92,6 +92,8 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_BSD
#elif defined __linux__
#define TORRENT_LINUX
#elif defined __MINGW32__
#define TORRENT_MINGW
#elif defined WIN32
#define TORRENT_WINDOWS
#elif defined sun || defined __sun

View File

@ -55,7 +55,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <sys/sysctl.h>
#endif
#if defined TORRENT_WINDOWS
#if defined TORRENT_WINDOWS || defined TORRENT_MINGW
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
@ -326,7 +326,7 @@ namespace libtorrent
}
close(s);
#elif defined TORRENT_WINDOWS
#elif defined TORRENT_WINDOWS || defined TORRENT_MINGW
SOCKET s = socket(AF_INET, SOCK_DGRAM, 0);
if (s == SOCKET_ERROR)
@ -380,7 +380,7 @@ namespace libtorrent
address get_default_gateway(io_service& ios, error_code& ec)
{
std::vector<ip_route> ret = enum_routes(ios, ec);
#ifdef TORRENT_WINDOWS
#if defined TORRENT_WINDOWS || defined TORRENT_MINGW
std::vector<ip_route>::iterator i = std::find_if(ret.begin(), ret.end()
, boost::bind(&is_loopback, boost::bind(&ip_route::destination, _1)));
#else
@ -536,7 +536,7 @@ namespace libtorrent
if (parse_route(rtm, &r)) ret.push_back(r);
}
#elif defined TORRENT_WINDOWS
#elif defined TORRENT_WINDOWS || defined TORRENT_MINGW
// Load Iphlpapi library
HMODULE iphlp = LoadLibraryA("Iphlpapi.dll");

View File

@ -111,7 +111,7 @@ namespace
}
#endif
#ifdef _WIN32
#ifdef TORRENT_WINDOWS
// for ERROR_SEM_TIMEOUT
#include <winerror.h>
#endif