fixed logging build

This commit is contained in:
Arvid Norberg
2010-10-24 08:06:58 +00:00
parent 2e71bc818c
commit 07f1b74291
3 changed files with 34 additions and 43 deletions

View File

@@ -35,93 +35,84 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/stringize.hpp>
#ifdef TORRENT_DEBUG #ifdef TORRENT_DEBUG
#define TORRENT_CFG_DEBUG dbg- #define TORRENT_CFG_DEBUG dbg_
#else #else
#define TORRENT_CFG_DEBUG #define TORRENT_CFG_DEBUG rel_
#endif #endif
#if TORRENT_USE_BOOST_DATE_TIME #if TORRENT_USE_BOOST_DATE_TIME
#define TORRENT_CFG_TIME boosttime- #define TORRENT_CFG_TIME boosttime_
#elif TORRENT_USE_ABSOLUTE_TIME #elif TORRENT_USE_ABSOLUTE_TIME
#define TORRENT_CFG_TIME absolutetime- #define TORRENT_CFG_TIME absolutetime_
#elif TORRENT_USE_PERFORMANCE_TIMER #elif TORRENT_USE_PERFORMANCE_TIMER
#define TORRENT_CFG_TIME performancetimer- #define TORRENT_CFG_TIME performancetimer_
#elif TORRENT_USE_CLOCK_GETTIME #elif TORRENT_USE_CLOCK_GETTIME
#define TORRENT_CFG_TIME clocktime- #define TORRENT_CFG_TIME clocktime_
#elif TORRENT_USE_SYSTEM_TIME #elif TORRENT_USE_SYSTEM_TIME
#define TORRENT_CFG_TIME systime- #define TORRENT_CFG_TIME systime_
#else #else
#error what timer is used? #error what timer is used?
#endif #endif
#if TORRENT_USE_IPV6 #if TORRENT_USE_IPV6
#define TORRENT_CFG_IPV6 ipv6- #define TORRENT_CFG_IPV6 ipv6_
#else #else
#define TORRENT_CFG_IPV6 noipv6- #define TORRENT_CFG_IPV6 noipv_-
#endif #endif
#ifdef TORRENT_DISABLE_DHT #ifdef TORRENT_DISABLE_DHT
#define TORRENT_CFG_DHT nodht- #define TORRENT_CFG_DHT nodht_
#else #else
#define TORRENT_CFG_DHT dht- #define TORRENT_CFG_DHT dht_
#endif #endif
#ifdef TORRENT_DISABLE_POOL_ALLOCATORS #ifdef TORRENT_DISABLE_POOL_ALLOCATORS
#define TORRENT_CFG_POOL nopools- #define TORRENT_CFG_POOL nopools_
#else #else
#define TORRENT_CFG_POOL pools- #define TORRENT_CFG_POOL pools_
#endif #endif
#ifdef TORRENT_VERBOSE_LOGGING #ifdef TORRENT_VERBOSE_LOGGING
#define TORRENT_CFG_LOG verboselog- #define TORRENT_CFG_LOG verboselog_
#elif defined TORRENT_LOGGING #elif defined TORRENT_LOGGING
#define TORRENT_CFG_LOG log- #define TORRENT_CFG_LOG log_
#else #else
#define TORRENT_CFG_LOG nolog- #define TORRENT_CFG_LOG nolog_
#endif #endif
#ifdef _UNICODE #ifdef _UNICODE
#define TORRENT_CFG_UNICODE unicode- #define TORRENT_CFG_UNICODE unicode_
#else #else
#define TORRENT_CFG_UNICODE ansi- #define TORRENT_CFG_UNICODE ansi_
#endif #endif
#ifdef TORRENT_DISABLE_RESOLVE_COUNTRIES #ifdef TORRENT_DISABLE_RESOLVE_COUNTRIES
#define TORRENT_CFG_RESOLVE noresolvecountries- #define TORRENT_CFG_RESOLVE noresolvecountries_
#else #else
#define TORRENT_CFG_RESOLVE resolvecountries- #define TORRENT_CFG_RESOLVE resolvecountries_
#endif #endif
#ifdef TORRENT_NO_DEPRECATE #ifdef TORRENT_NO_DEPRECATE
#define TORRENT_CFG_DEPR nodeprecate- #define TORRENT_CFG_DEPR nodeprecate_
#else #else
#define TORRENT_CFG_DEPR deprecated- #define TORRENT_CFG_DEPR deprecated_
#endif #endif
#ifdef TORRENT_DISABLE_FULL_STATS #ifdef TORRENT_DISABLE_FULL_STATS
#define TORRENT_CFG_STATS partialstats- #define TORRENT_CFG_STATS partialstats_
#else #else
#define TORRENT_CFG_STATS fullstats- #define TORRENT_CFG_STATS fullstats_
#endif #endif
#ifdef TORRENT_DISABLE_EXTENSIONS #ifdef TORRENT_DISABLE_EXTENSIONS
#define TORRENT_CFG_EXT noext- #define TORRENT_CFG_EXT noext_
#else #else
#define TORRENT_CFG_EXT ext- #define TORRENT_CFG_EXT ext_
#endif #endif
#define TORRENT_CFG_STRING \
#TORRENT_CFG_DEBUG \
#TORRENT_CFG_TIME \
#TORRENT_CFG_POOL \
#TORRENT_CFG_LOG \
#TORRENT_CFG_RESOLVE \
#TORRENT_CFG_DEPR \
#TORRENT_CFG_DHT \
#TORRENT_CFG_EXT
#define TORRENT_CFG \ #define TORRENT_CFG \
BOOST_PP_CAT(TORRENT_CFG_DEBUG, \ BOOST_PP_CAT(TORRENT_CFG_DEBUG, \
BOOST_PP_CAT(TORRENT_CFG_TIME, \ BOOST_PP_CAT(TORRENT_CFG_TIME, \
@@ -132,5 +123,7 @@ POSSIBILITY OF SUCH DAMAGE.
BOOST_PP_CAT(TORRENT_CFG_DHT, \ BOOST_PP_CAT(TORRENT_CFG_DHT, \
TORRENT_CFG_EXT))))))) TORRENT_CFG_EXT)))))))
#define TORRENT_CFG_STRING BOOST_PP_STRINGIZE(TORRENT_CFG)
#endif #endif

View File

@@ -312,7 +312,7 @@ namespace libtorrent
void session::init(std::pair<int, int> listen_range, char const* listen_interface void session::init(std::pair<int, int> listen_range, char const* listen_interface
, fingerprint const& id, int flags, int alert_mask TORRENT_LOGPATH_ARG) , fingerprint const& id, int flags, int alert_mask TORRENT_LOGPATH_ARG)
{ {
m_impl.reset(new session_impl(listen_range, id, listen_interface) TORRENT_LOGPATH); m_impl.reset(new session_impl(listen_range, id, listen_interface TORRENT_LOGPATH));
#ifdef TORRENT_MEMDEBUG #ifdef TORRENT_MEMDEBUG
start_malloc_debug(); start_malloc_debug();

View File

@@ -632,12 +632,10 @@ namespace aux {
PRINT_SIZEOF(bandwidth_channel) PRINT_SIZEOF(bandwidth_channel)
PRINT_SIZEOF(policy) PRINT_SIZEOF(policy)
PRINT_SIZEOF(stat_channel) // PRINT_SIZEOF(stat_channel)
PRINT_OFFSETOF(stat_channel, m_rate_history) // PRINT_OFFSETOF(stat_channel, m_counter)
PRINT_OFFSETOF(stat_channel, m_window) // PRINT_OFFSETOF(stat_channel, m_average)
PRINT_OFFSETOF(stat_channel, m_counter) // PRINT_OFFSETOF(stat_channel, m_total_counter)
PRINT_OFFSETOF(stat_channel, m_total_counter)
PRINT_OFFSETOF(stat_channel, m_rate_sum)
torrent::print_size(*m_logger); torrent::print_size(*m_logger);