fix mingw build
This commit is contained in:
parent
bcd44536a8
commit
381f42bcf2
|
@ -168,10 +168,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#define TORRENT_USE_LOCALE 1
|
||||
#endif
|
||||
#define TORRENT_USE_RLIMIT 0
|
||||
#define TORRENT_USE_NETLINK 1
|
||||
#define TORRENT_USE_NETLINK 0
|
||||
#define TORRENT_USE_GETADAPTERSADDRESSES 1
|
||||
#define TORRENT_HAS_SALEN 0
|
||||
#define TORRENT_USE_GETIPFORWARDTABLE 0
|
||||
#define TORRENT_USE_GETIPFORWARDTABLE 1
|
||||
|
||||
// ==== WINDOWS ===
|
||||
#elif defined WIN32
|
||||
|
|
|
@ -43,21 +43,21 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <boost/asio/ip/host_name.hpp>
|
||||
#endif
|
||||
|
||||
#if defined TORRENT_BSD || defined TORRENT_SOLARIS
|
||||
#if TORREN_USE_IFCONF
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
#include <string.h>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#endif
|
||||
|
||||
#if TORRENT_USE_SYSCTL
|
||||
#include <sys/sysctl.h>
|
||||
#include <net/route.h>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#endif
|
||||
|
||||
#if defined TORRENT_WINDOWS || defined TORRENT_MINGW
|
||||
#if TORRENT_USE_GETIPFORWARDTABLE || TORRENT_USE_GETADAPTERSADDRESSES
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
@ -65,7 +65,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <iphlpapi.h>
|
||||
#endif
|
||||
|
||||
#if defined TORRENT_LINUX
|
||||
#if TORRENT_USE_NETLINK
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <asm/types.h>
|
||||
#include <netinet/ether.h>
|
||||
#include <netinet/in.h>
|
||||
|
@ -73,8 +75,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <stdio.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
|
@ -871,6 +871,14 @@ namespace libtorrent
|
|||
return std::vector<ip_route>();
|
||||
}
|
||||
|
||||
typedef DWORD (WINAPI *GetIfEntry_t)(PMIB_IFROW pIfRow);
|
||||
GetIfEntry_t GetIfEntry = (GetIfEntry_t)GetProcAddress(iphlp, "GetIfEntry");
|
||||
if (!GetIfEntry)
|
||||
{
|
||||
ec = asio::error::operation_not_supported;
|
||||
return std::vector<ip_route>();
|
||||
}
|
||||
|
||||
#if _WIN32_WINNT >= 0x0600
|
||||
typedef DWORD (WINAPI *GetIpForwardTable2_t)(
|
||||
ADDRESS_FAMILY, PMIB_IPFORWARD_TABLE2*);
|
||||
|
|
Loading…
Reference in New Issue