1. --- btg-1.0.0/daemon/ipfilter/emule.cpp.orig    2010-06-04 00:23:27.217870889 +0200
  2. +++ btg-1.0.0/daemon/ipfilter/emule.cpp 2010-06-04 00:24:34.785426517 +0200
  3. @@ -30,7 +30,7 @@
  4.  
  5.  #include <fstream>
  6.  
  7. -#if BTG_LT_0_14
  8. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  9.  #  include <boost/asio/ip/address_v4.hpp>
  10.  #else
  11.  #  include <asio/ip/address_v4.hpp>
  12. @@ -146,7 +146,7 @@
  13.                                                     boost::array<unsigned char, 4u> const ip2 = {{ipa1[0], ipa1[1], ipa1[2], ipa1[3]}};
  14.                                                     try
  15.                                                        {
  16. -#if BTG_LT_0_14
  17. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  18.                                                           boost::asio::ip::address_v4 address1(ip1);
  19.                                                           boost::asio::ip::address_v4 address2(ip2);
  20.  #else
  21. --- btg-1.0.0/daemon/ipfilter/levelone.cpp.orig 2010-06-04 00:25:18.228692754 +0200
  22. +++ btg-1.0.0/daemon/ipfilter/levelone.cpp  2010-06-04 00:26:11.468754496 +0200
  23. @@ -30,7 +30,7 @@
  24.  
  25.  #include <fstream>
  26.  
  27. -#if BTG_LT_0_14
  28. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  29.  #  include <boost/asio/ip/address_v4.hpp>
  30.  #else
  31.  #  include <asio/ip/address_v4.hpp>
  32. @@ -133,7 +133,7 @@
  33.                                                     boost::array<unsigned char, 4u> const ip2 = {{ipa1[0], ipa1[1], ipa1[2], ipa1[3]}};
  34.                                                     try
  35.                                                        {
  36. -#if BTG_LT_0_14
  37. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  38.                                                           boost::asio::ip::address_v4 address1(ip1);
  39.                                                           boost::asio::ip::address_v4 address2(ip2);
  40.  #else
  41. --- btg-1.0.0/daemon/lt_version.h.orig  2010-06-03 23:56:41.134698301 +0200
  42. +++ btg-1.0.0/daemon/lt_version.h   2010-06-04 00:15:18.003628154 +0200
  43. @@ -25,11 +25,13 @@
  44.  
  45.  #include <libtorrent/version.hpp>
  46.  
  47. +#define BTG_LT_0_15 ((LIBTORRENT_VERSION_MAJOR == 0) && (LIBTORRENT_VERSION_MINOR == 15))
  48.  #define BTG_LT_0_14 ((LIBTORRENT_VERSION_MAJOR == 0) && (LIBTORRENT_VERSION_MINOR == 14))
  49.  #define BTG_LT_0_13 ((LIBTORRENT_VERSION_MAJOR == 0) && (LIBTORRENT_VERSION_MINOR == 13))
  50.  #define BTG_LT_0_12 ((LIBTORRENT_VERSION_MAJOR == 0) && (LIBTORRENT_VERSION_MINOR == 12))
  51.  
  52. -#if BTG_LT_0_14
  53. +#if BTG_LT_0_15
  54. +#elif BTG_LT_0_14
  55.  #elif BTG_LT_0_13
  56.  #elif BTG_LT_0_12
  57.  #else
  58. --- btg-1.0.0/daemon/daemonhandler.cpp.orig 2010-06-04 00:26:37.178685664 +0200
  59. +++ btg-1.0.0/daemon/daemonhandler.cpp  2010-06-04 00:27:06.161255753 +0200
  60. @@ -631,7 +631,7 @@
  61.           vrc->setOption(versionResponseCommand::UPNP);
  62.  #endif
  63.  
  64. -#if (BTG_LT_0_13 || BTG_LT_0_14)
  65. +#if (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  66.           vrc->setOption(versionResponseCommand::DHT);
  67.           vrc->setOption(versionResponseCommand::ENCRYPTION);
  68.           vrc->setOption(versionResponseCommand::SELECTIVE_DL);
  69. --- btg-1.0.0/daemon/btgdaemon.cpp.orig 2010-06-04 00:27:20.921181255 +0200
  70. +++ btg-1.0.0/daemon/btgdaemon.cpp  2010-06-04 00:27:45.382075527 +0200
  71. @@ -81,7 +81,7 @@
  72.  #    include "upnp/cyberlink.h"
  73.  #  endif // BTG_OPTION_USECYBERLINK
  74.  
  75. -#if BTG_LT_0_14
  76. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  77.  #  include "upnp/ltupnpif.h"
  78.  #endif
  79.  
  80. --- btg-1.0.0/daemon/context_file.cpp.orig  2010-06-04 00:28:32.305340940 +0200
  81. +++ btg-1.0.0/daemon/context_file.cpp   2010-06-04 00:30:38.028725659 +0200
  82. @@ -66,7 +66,7 @@
  83.                               "Attempt to move '" << filename << "' to " << _destination_dir << " failed.");
  84.                 result = false;
  85.              }
  86. -#elif (BTG_LT_0_13 || BTG_LT_0_14)
  87. +#elif (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  88.           ti->handle.move_storage(_destination_dir);
  89.  #endif // lt version
  90.           BTG_MEXIT(logWrapper(), "moveToDirectory", result);
  91. @@ -485,7 +485,7 @@
  92.  
  93.                 BTG_MNOTICE(logWrapper(), "wrote fast resume data for '" << filename << "'");
  94.                 out.close();
  95. -#elif BTG_LT_0_14
  96. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  97.                 // The actual writting is done using a callback.
  98.                 // TODO: implement this!
  99.                 ti->handle.save_resume_data();
  100. @@ -522,7 +522,7 @@
  101.  
  102.           return status;
  103.        }
  104. -#if BTG_LT_0_14
  105. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  106.        bool Context::torrentInfoToFiles(libtorrent::torrent_info const& _tinfo,
  107.                                         std::vector<std::string> & _output) const
  108.        {
  109. @@ -594,7 +594,7 @@
  110.        }
  111.  #endif
  112.  
  113. -#if (BTG_LT_0_14)
  114. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  115.        void Context::bitfieldToVector(libtorrent::bitfield const& _input,
  116.                                       std::vector<bool> & _output) const
  117.        {
  118. --- btg-1.0.0/daemon/context.h.orig 2010-06-04 00:30:48.621160387 +0200
  119. +++ btg-1.0.0/daemon/context.h  2010-06-04 00:32:10.674559090 +0200
  120. @@ -444,7 +444,7 @@
  121.  
  122.                 /// Handle libtorrent alert.
  123.                 void handlePeerError(libtorrent::peer_error_alert* _alert);
  124. -#if BTG_LT_0_14
  125. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  126.                 void handleTrackerAlert(libtorrent::tracker_error_alert* _alert);
  127.  #else
  128.                 /// Handle libtorrent alert.
  129. @@ -602,7 +602,7 @@
  130.                 /// Enable/disable using the torrent name from the
  131.                 /// tracker.
  132.                 bool const                                useTorrentName_;
  133. -#if BTG_LT_0_14
  134. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  135.                 /// Allocation mode used.
  136.                 libtorrent::storage_mode_t                allocation_mode_;
  137.  #endif
  138. @@ -665,7 +665,7 @@
  139.                                   std::vector<std::string> & _output) const;
  140.  #endif
  141.  
  142. -#if BTG_LT_0_14
  143. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  144.                 bool torrentInfoToFiles(libtorrent::torrent_info const& _tinfo,
  145.                                         std::vector<std::string> & _output) const;
  146.  #endif                                                
  147. @@ -709,7 +709,7 @@
  148.                 /// Convert an enum to a string, for debugging.
  149.                 std::string toString(addResult const _addresult) const;
  150.  
  151. -#if (BTG_LT_0_14)
  152. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  153.                 /// Convert a libtorrent bitfield into a vector of bits.
  154.                 ///
  155.                 /// Libtorrent 0.14 changed the way a torrent's pieces
  156. --- btg-1.0.0/daemon/context.cpp.orig   2010-06-04 00:33:56.738641809 +0200
  157. +++ btg-1.0.0/daemon/context.cpp    2010-06-04 00:41:47.447774562 +0200
  158. @@ -57,12 +57,12 @@
  159.  
  160.  #include "lt_version.h"
  161.  
  162. -#if (BTG_LT_0_13 || BTG_LT_0_14)
  163. +#if (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  164.  #include <libtorrent/extensions/metadata_transfer.hpp>
  165.  #include <libtorrent/extensions/ut_pex.hpp>
  166.  #endif
  167.  
  168. -#if BTG_LT_0_14
  169. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  170.  #include <libtorrent/alert.hpp>
  171.  #endif
  172.  
  173. @@ -156,7 +156,7 @@
  174.  #endif // BTG_OPTION_EVENTCALLBACK
  175.           , progress_(),
  176.             useTorrentName_(_useTorrentName)
  177. -#if BTG_LT_0_14
  178. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  179.  ,
  180.             allocation_mode_(libtorrent::storage_mode_sparse)
  181.  #endif
  182. @@ -168,7 +168,7 @@
  183.                      "Constructor", "_clientAttached = " << _clientAttached);
  184.  
  185.           portMgr->get(listen_port_range_);
  186. -#if BTG_LT_0_14
  187. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  188.           switch (config_->getAllocationMode())
  189.              {
  190.              case daemonConfiguration::SPARSE:
  191. @@ -228,7 +228,7 @@
  192.              {
  193.                 // Libtorrent created its threads.
  194.                 //
  195. -#if (BTG_LT_0_13 || BTG_LT_0_14)
  196. +#if (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  197.                 // Add the available extensions.
  198.                 torrent_session->add_extension(&libtorrent::create_ut_pex_plugin);
  199.  #endif
  200. @@ -258,7 +258,7 @@
  201.  
  202.  #if (BTG_LT_0_12 || BTG_LT_0_13)
  203.                 torrent_session->set_severity_level(libtorrent::alert::info);
  204. -#elif BTG_LT_0_14
  205. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  206.                 {
  207.                    int amask =
  208.                       libtorrent::alert::error_notification |
  209. @@ -486,7 +486,7 @@
  210.                    }
  211.              }
  212.  
  213. -#if (BTG_LT_0_13 || BTG_LT_0_14)
  214. +#if (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  215.           // Enable encryption.
  216.           if (useEncryption_)
  217.              {
  218. @@ -561,7 +561,7 @@
  219.                 BTG_MEXIT(logWrapper(), "add", status);
  220.                 return status;
  221.              }
  222. -#elif BTG_LT_0_14
  223. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  224.           status = Context::ERR_OK;
  225.  #endif
  226.  
  227. @@ -571,7 +571,7 @@
  228.  #elif BTG_LT_0_13
  229.           boost::intrusive_ptr<libtorrent::torrent_info> tinfo(new libtorrent::torrent_info);
  230.           if (!entryToInfo(torrent_entry, *tinfo))
  231. -#elif BTG_LT_0_14
  232. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  233.           boost::intrusive_ptr<libtorrent::torrent_info> tinfo;
  234.           bool gotInfo = true;
  235.           try
  236. @@ -619,7 +619,7 @@
  237.                 BTG_MEXIT(logWrapper(), "add", status);
  238.                 return status;
  239.              }
  240. -#elif BTG_LT_0_14
  241. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  242.           if (!torrentInfoToFiles(*tinfo, contained_files))
  243.              {
  244.                 filetrack_->remove(tempDir_, fileTrackFilename);
  245. @@ -652,7 +652,7 @@
  246.           torrentStorage ts = tsWork;
  247.  #if BTG_LT_0_12
  248.           if (dataPresentInSeedDir(tinfo))
  249. -#elif (BTG_LT_0_13 || BTG_LT_0_14)
  250. +#elif (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  251.           if (dataPresentInSeedDir(*tinfo))
  252.  #endif
  253.              {
  254. @@ -676,7 +676,7 @@
  255.                       in.unsetf(std::ios_base::skipws);
  256.  #if (BTG_LT_0_12 || BTG_LT_0_13)
  257.                       libtorrent::entry fastResumeEntry;
  258. -#elif BTG_LT_0_14
  259. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  260.                       std::vector<char>* resumeData       = new std::vector<char>;
  261.  #endif
  262.                       try
  263. @@ -686,7 +686,7 @@
  264.                                                                   std::istream_iterator<char>(in),
  265.                                                                   std::istream_iterator<char>()
  266.                                                                   );
  267. -#elif BTG_LT_0_14
  268. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  269.                             std::copy(std::istream_iterator<char>(in),
  270.                                       std::istream_iterator<char>(),
  271.                                       std::back_inserter(*resumeData));
  272. @@ -705,7 +705,7 @@
  273.                             handle = torrent_session->add_torrent(torrent_entry, dataPath, fastResumeEntry);        
  274.  #elif BTG_LT_0_13
  275.                             handle = torrent_session->add_torrent(tinfo, dataPath, fastResumeEntry);
  276. -#elif BTG_LT_0_14
  277. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  278.                             libtorrent::add_torrent_params atp;
  279.                             atp.name         = 0; // "default name";
  280.                             atp.ti.swap(tinfo);
  281. @@ -726,7 +726,7 @@
  282.                       handle = torrent_session->add_torrent(torrent_entry, dataPath);
  283.  #elif BTG_LT_0_13
  284.                       handle = torrent_session->add_torrent(tinfo, dataPath);
  285. -#elif BTG_LT_0_14
  286. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  287.                       libtorrent::add_torrent_params atp;
  288.                       atp.name         = 0; // "default name";
  289.                       atp.ti.swap(tinfo);
  290. @@ -1243,7 +1243,7 @@
  291.  
  292.           switch (status.state)
  293.              {
  294. -#if BTG_LT_0_14
  295. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  296.              case libtorrent::torrent_status::allocating:
  297.  #endif
  298.              case libtorrent::torrent_status::queued_for_checking:
  299. @@ -1254,7 +1254,7 @@
  300.                 break;
  301.  #if (BTG_LT_0_12) || (BTG_LT_0_13)
  302.              case libtorrent::torrent_status::connecting_to_tracker:
  303. -#elif BTG_LT_0_14
  304. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  305.              case libtorrent::torrent_status::downloading_metadata:
  306.  #endif
  307.                 ts = Status::ts_connecting;
  308. @@ -1555,7 +1555,7 @@
  309.           libtorrent::torrent_info t_i      = ti->handle.get_torrent_info();
  310.  #if (BTG_LT_0_12 || BTG_LT_0_13)
  311.           const std::vector<bool>* pieces   = status.pieces;
  312. -#elif BTG_LT_0_14
  313. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  314.           /// !!!
  315.           std::vector<bool> piecevector;
  316.           bitfieldToVector(status.pieces, piecevector);
  317. @@ -1660,7 +1660,7 @@
  318.                 for (iter = peerinfolist.begin(); iter != peerinfolist.end(); iter++)
  319.                    {
  320.                       // Convert the peer ip from the libtorrent implementation to 4 bytes.
  321. -#if BTG_LT_0_14
  322. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  323.                       boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> endp = iter->ip;
  324.                       boost::asio::ip::address_v4 addr = endp.address().to_v4();
  325.  #else
  326. @@ -1706,14 +1706,14 @@
  327.                       }
  328.                       for(t_uint i = *_peerExOffset, endi = *_peerExOffset + *_peerExCount; i < endi; ++i)
  329.                       {
  330. -#if BTG_LT_0_14
  331. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  332.                          std::vector<bool> fpieces;
  333.                          bitfieldToVector(peerinfolist[i].pieces, fpieces);
  334.  #endif
  335.  
  336.                          PeerEx peerEx(
  337.                             peerinfolist[i].flags,
  338. -#if BTG_LT_0_13 || BTG_LT_0_14
  339. +#if BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15
  340.                             peerinfolist[i].source,
  341.  #elif BTG_LT_0_12
  342.                             0,
  343. @@ -1726,7 +1726,7 @@
  344.                             peerinfolist[i].total_upload,
  345.  #if BTG_LT_0_12 || BTG_LT_0_13
  346.                             peerinfolist[i].pieces,
  347. -#elif BTG_LT_0_14
  348. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  349.                             fpieces,
  350.  #endif
  351.                             peerinfolist[i].download_limit,
  352. @@ -1745,7 +1745,7 @@
  353.                             peerinfolist[i].downloading_total,
  354.                             peerinfolist[i].client,
  355.                             peerinfolist[i].connection_type,
  356. -#if BTG_LT_0_13 || BTG_LT_0_14
  357. +#if BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15
  358.                             libtorrent::total_seconds(peerinfolist[i].last_request),
  359.                             libtorrent::total_seconds(peerinfolist[i].last_active),
  360.                             peerinfolist[i].num_hashfails,
  361. @@ -1915,7 +1915,7 @@
  362.              case libtorrent::torrent_status::checking_files:
  363.  #if (BTG_LT_0_12) || (BTG_LT_0_13)
  364.              case libtorrent::torrent_status::connecting_to_tracker:
  365. -#elif BTG_LT_0_14
  366. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  367.              case libtorrent::torrent_status::downloading_metadata:
  368.  #endif
  369.              case libtorrent::torrent_status::downloading:
  370. @@ -1977,7 +1977,7 @@
  371.                                         btg::core::selectedFileEntryList const& _input)
  372.        {
  373.           BTG_MENTER(logWrapper(), "applySelectedFiles", "torrent info");
  374. -#if (BTG_LT_0_13 || BTG_LT_0_14)
  375. +#if (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  376.           enum lt_file_priority
  377.           {
  378.              LTF_NO  = 0,
  379. @@ -2069,7 +2069,7 @@
  380.           libtorrent::torrent_status status = ti->handle.status();
  381.  #if (BTG_LT_0_12) || (BTG_LT_0_13)
  382.           if ((status.state == libtorrent::torrent_status::connecting_to_tracker)
  383. -#elif BTG_LT_0_14
  384. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  385.           if ((status.state == libtorrent::torrent_status::downloading_metadata)
  386.  #endif
  387.               ||
  388. @@ -2372,7 +2372,7 @@
  389.                 MVERBOSE_LOG(logWrapper(), verboseFlag_, "Using WAN (announce ip): " << announceIp);
  390.  #if (BTG_LT_0_13)
  391.                 session_settings_.announce_ip = asio::ip::address(asio::ip::address_v4::from_string(announceIp));
  392. -#elif BTG_LT_0_14
  393. +#elif (BTG_LT_0_14 || BTG_LT_0_15)
  394.                 session_settings_.announce_ip = boost::asio::ip::address(boost::asio::ip::address_v4::from_string(announceIp));
  395.  #endif
  396.              }
  397. @@ -2396,7 +2396,7 @@
  398.        void Context::setProxyHttpSettings(btg::core::addressPort const& _proxy)
  399.        {
  400.           BTG_MNOTICE(logWrapper(), "setting session settings: proxy");
  401. -#if (BTG_LT_0_13 || BTG_LT_0_14)
  402. +#if (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  403.           libtorrent::proxy_settings ps;
  404.           ps.hostname = _proxy.getIp();
  405.           ps.port     = _proxy.getPort();
  406. @@ -2528,7 +2528,7 @@
  407.  
  408.        void Context::enableEncryption()
  409.        {
  410. -#if (BTG_LT_0_13 || BTG_LT_0_14)
  411. +#if (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  412.           try
  413.              {
  414.                 libtorrent::pe_settings enc_settings;
  415. --- btg-1.0.0/daemon/context_session.cpp.orig   2010-06-04 00:32:53.007815608 +0200
  416. +++ btg-1.0.0/daemon/context_session.cpp    2010-06-04 00:33:42.437830589 +0200
  417. @@ -130,7 +130,7 @@
  418.                 libtorrent::peer_id pid;
  419.  #if BTG_LT_0_12
  420.                 pid = 0;
  421. -#elif (BTG_LT_0_13 || BTG_LT_0_14)
  422. +#elif (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  423.                 pid = torrent_session->id();
  424.  #endif
  425.                 std::string peerid = btg::core::convertToString<libtorrent::peer_id>(pid);
  426. @@ -313,7 +313,7 @@
  427.                             if (_version >= 0x89)
  428.                             {
  429.                          bool asfr = applySelectedFiles(ti,aSelectedFileEntryList);
  430. -#if (BTG_LT_0_13 || BTG_LT_0_14)
  431. +#if (BTG_LT_0_13 || BTG_LT_0_14 || BTG_LT_0_15)
  432.                                 BTG_CDC(!asfr, "call applySelectedFiles");
  433.  #elif BTG_LT_0_12
  434.                          // Selecting files is not supported by 0.12.x, so ignore this.
  435. --- btg-1.0.0/daemon/context_alert.cpp.orig 2010-06-04 00:43:02.937753224 +0200
  436. +++ btg-1.0.0/daemon/context_alert.cpp  2010-06-04 00:45:11.414475333 +0200
  437. @@ -25,7 +25,7 @@
  438.  #include <bcore/trackerstatus.h>
  439.  #include <bcore/logmacro.h>
  440.  
  441. -#if BTG_LT_0_14
  442. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  443.  #  include <boost/asio/ip/address_v4.hpp>
  444.  #else
  445.  #  include <asio/ip/address_v4.hpp>
  446. @@ -48,7 +48,7 @@
  447.        void Context::handleBannedHost(libtorrent::peer_ban_alert* _alert)
  448.        {
  449.           // A peer was banned.
  450. -#if BTG_LT_0_14
  451. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  452.           boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> endp = _alert->ip;
  453.           boost::asio::ip::address_v4 banned_ip = endp.address().to_v4();
  454.  #else
  455. @@ -116,7 +116,7 @@
  456.        void Context::handlePeerError(libtorrent::peer_error_alert* _alert)
  457.        {
  458.           // A peer generates errors.
  459. -#if BTG_LT_0_14
  460. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  461.           boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> endp = _alert->ip;
  462.           boost::asio::ip::address_v4 banned_ip = endp.address().to_v4();
  463.  #else
  464. @@ -125,7 +125,7 @@
  465.  #endif
  466.           BTG_NOTICE(logWrapper(), "Errors from peer: " << banned_ip.to_string() << ".");
  467.        }
  468. -#if BTG_LT_0_14
  469. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  470.        void Context::handleTrackerAlert(libtorrent::tracker_error_alert* _alert)
  471.  #else
  472.        void Context::handleTrackerAlert(libtorrent::tracker_alert* _alert)
  473. @@ -142,7 +142,7 @@
  474.                             verboseFlag_, "Tracker alert: filename '" <<
  475.                             filename << "', status = " <<
  476.                             _alert->status_code << ", message '" <<
  477. -#if BTG_LT_0_14
  478. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  479.                             _alert->message()
  480.  #else
  481.                             _alert->msg()
  482. @@ -161,7 +161,7 @@
  483.                    }              
  484.                 ti->trackerStatus.setSerial(ti->serial);
  485.                 ti->trackerStatus.setMessage(
  486. -#if BTG_LT_0_14
  487. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  488.                                              _alert->message()
  489.  #else
  490.                                              _alert->msg()
  491. @@ -215,7 +215,7 @@
  492.                 getFilename(torrent_id, filename);
  493.                 VERBOSE_LOG(logWrapper(), verboseFlag_, "Tracker warning alert: filename '" <<
  494.                             filename << "', message '" <<
  495. -#if BTG_LT_0_14
  496. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  497.                             _alert->message()
  498.  #else
  499.                             _alert->msg()
  500. @@ -226,7 +226,7 @@
  501.                 ti->trackerStatus.setStatus(trackerStatus::warning);
  502.                 ti->trackerStatus.setSerial(ti->serial);
  503.                 ti->trackerStatus.setMessage(
  504. -#if BTG_LT_0_14
  505. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  506.                 _alert->message()
  507.  #else
  508.                 _alert->msg()
  509. @@ -274,7 +274,7 @@
  510.                       {
  511.                          handlePeerError(dynamic_cast<libtorrent::peer_error_alert*>(alert));
  512.                       }
  513. -#if BTG_LT_0_14
  514. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  515.                    else if (typeid(*alert) == typeid(libtorrent::tracker_error_alert))
  516.                       {
  517.                          handleTrackerAlert(dynamic_cast<libtorrent::tracker_error_alert*>(alert));
  518. @@ -297,7 +297,7 @@
  519.                       {
  520.                          // Log other alerts.
  521.                          BTG_NOTICE(logWrapper(), "Alert: " <<
  522. -#if BTG_LT_0_14
  523. +#if (BTG_LT_0_14 || BTG_LT_0_15)
  524.                                     alert->message()
  525.  #else
  526.                                     alert->msg()