From 9e29eb997818f01fde5b47cbaae66c777c09410b Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Wed, 12 Aug 2015 23:00:28 -0400 Subject: [PATCH] Introduced TORRENT_UTP_LOG_ENABLE macro to guarantee that TORRENT_UTP_LOG and TORRENT_VERBOSE_UTP_LOG are always defined (no need to change a lot of macro if). --- Jamfile | 3 +-- include/libtorrent/utp_stream.hpp | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Jamfile b/Jamfile index e7ac7cd9c..963d6cd77 100644 --- a/Jamfile +++ b/Jamfile @@ -473,8 +473,7 @@ feature disk-stats : off on : composite propagated link-incompatible ; feature.compose on : TORRENT_DISK_STATS ; feature utp-log : off on : composite propagated link-incompatible ; -feature.compose off : TORRENT_UTP_LOG=0 TORRENT_VERBOSE_UTP_LOG=0 ; -feature.compose on : TORRENT_UTP_LOG=1 TORRENT_VERBOSE_UTP_LOG=1 ; +feature.compose on : TORRENT_UTP_LOG_ENABLE ; feature simulate-slow-read : off on : composite propagated ; feature.compose on : TORRENT_SIMULATE_SLOW_READ ; diff --git a/include/libtorrent/utp_stream.hpp b/include/libtorrent/utp_stream.hpp index 4c97f176f..7105fbda6 100644 --- a/include/libtorrent/utp_stream.hpp +++ b/include/libtorrent/utp_stream.hpp @@ -55,6 +55,13 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { +#ifndef TORRENT_UTP_LOG_ENABLE + #define TORRENT_UTP_LOG 0 + #define TORRENT_VERBOSE_UTP_LOG 0 +#else + #define TORRENT_UTP_LOG 1 + #define TORRENT_VERBOSE_UTP_LOG 1 +#endif #ifdef TORRENT_UTP_LOG bool is_utp_stream_logging();