From e3f7dfe811b07628a57c6dfb580fc48c57c2bd53 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Fri, 24 Jan 2014 10:39:35 -0200 Subject: [PATCH] apply patch from http://sourceforge.net/p/cygwin-ports/libtorrent-rasterbar/ci/master/tree/0.16.7-cygwin.patch --- libtorrent/include/libtorrent/address.hpp | 2 +- libtorrent/include/libtorrent/config.hpp | 12 ++++++++++++ libtorrent/include/libtorrent/error.hpp | 2 +- libtorrent/include/libtorrent/error_code.hpp | 2 +- libtorrent/include/libtorrent/io_service.hpp | 2 +- libtorrent/include/libtorrent/socket.hpp | 2 +- libtorrent/include/libtorrent/thread.hpp | 2 +- libtorrent/src/thread.cpp | 2 +- 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/libtorrent/include/libtorrent/address.hpp b/libtorrent/include/libtorrent/address.hpp index 232b6ee9..ed7ca079 100644 --- a/libtorrent/include/libtorrent/address.hpp +++ b/libtorrent/include/libtorrent/address.hpp @@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE. #define Protocol Protocol_ #endif -#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN +#if defined TORRENT_WINDOWS // asio assumes that the windows error codes are defined already #include #endif diff --git a/libtorrent/include/libtorrent/config.hpp b/libtorrent/include/libtorrent/config.hpp index b575ef3e..2356f9c1 100644 --- a/libtorrent/include/libtorrent/config.hpp +++ b/libtorrent/include/libtorrent/config.hpp @@ -33,6 +33,11 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_CONFIG_HPP_INCLUDED #define TORRENT_CONFIG_HPP_INCLUDED +#if defined __CYGWIN__ +#define __STDC_LIMIT_MACROS 1 +#define __STDC_FORMAT_MACROS 1 +#endif + #include #include #include // for snprintf @@ -235,6 +240,13 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_USE_EXECINFO 1 #endif +// ==== CYGWIN === +#elif defined __CYGWIN__ +#define TORRENT_CYGWIN +#define TORRENT_USE_IFADDRS 1 +#define TORRENT_USE_IFCONF 1 +#define TORRENT_HAS_SALEN 0 + // ==== MINGW === #elif defined __MINGW32__ #define TORRENT_MINGW diff --git a/libtorrent/include/libtorrent/error.hpp b/libtorrent/include/libtorrent/error.hpp index 50ce6e65..1b2af070 100644 --- a/libtorrent/include/libtorrent/error.hpp +++ b/libtorrent/include/libtorrent/error.hpp @@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include "libtorrent/config.hpp" -#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN +#if defined TORRENT_WINDOWS // asio assumes that the windows error codes are defined already #include #endif diff --git a/libtorrent/include/libtorrent/error_code.hpp b/libtorrent/include/libtorrent/error_code.hpp index d230ad56..c97a9679 100644 --- a/libtorrent/include/libtorrent/error_code.hpp +++ b/libtorrent/include/libtorrent/error_code.hpp @@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include "libtorrent/config.hpp" -#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN +#if defined TORRENT_WINDOWS // asio assumes that the windows error codes are defined already #include #endif diff --git a/libtorrent/include/libtorrent/io_service.hpp b/libtorrent/include/libtorrent/io_service.hpp index 886cd49b..9bdcca7f 100644 --- a/libtorrent/include/libtorrent/io_service.hpp +++ b/libtorrent/include/libtorrent/io_service.hpp @@ -43,7 +43,7 @@ POSSIBILITY OF SUCH DAMAGE. #include -#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN +#if defined TORRENT_WINDOWS // asio assumes that the windows error codes are defined already #include #endif diff --git a/libtorrent/include/libtorrent/socket.hpp b/libtorrent/include/libtorrent/socket.hpp index f1952a0d..d36340f6 100644 --- a/libtorrent/include/libtorrent/socket.hpp +++ b/libtorrent/include/libtorrent/socket.hpp @@ -45,7 +45,7 @@ POSSIBILITY OF SUCH DAMAGE. #define Protocol Protocol_ #endif -#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN +#if defined TORRENT_WINDOWS // asio assumes that the windows error codes are defined already #include #endif diff --git a/libtorrent/include/libtorrent/thread.hpp b/libtorrent/include/libtorrent/thread.hpp index 5632e867..4f3ef9db 100644 --- a/libtorrent/include/libtorrent/thread.hpp +++ b/libtorrent/include/libtorrent/thread.hpp @@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/config.hpp" #include "libtorrent/time.hpp" -#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN +#if defined TORRENT_WINDOWS // asio assumes that the windows error codes are defined already #include #endif diff --git a/libtorrent/src/thread.cpp b/libtorrent/src/thread.cpp index 2f3c9b1b..dde81642 100644 --- a/libtorrent/src/thread.cpp +++ b/libtorrent/src/thread.cpp @@ -46,7 +46,7 @@ namespace libtorrent { void sleep(int milliseconds) { -#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN +#if defined TORRENT_WINDOWS Sleep(milliseconds); #elif defined TORRENT_BEOS snooze_until(system_time() + boost::int64_t(milliseconds) * 1000, B_SYSTEM_TIMEBASE);