From 62fef3cba01c30c80a042408fecb9dc636ffafc5 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 19 Mar 2012 02:43:06 +0000 Subject: [PATCH] fixed build configuration test in session.cpp --- include/libtorrent/config.hpp | 9 ++++++++- include/libtorrent/session.hpp | 5 +++++ src/session.cpp | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index dbb0abbdc..20966a9c6 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -39,7 +39,14 @@ POSSIBILITY OF SUCH DAMAGE. #include // for IOV_MAX #if defined TORRENT_DEBUG_BUFFERS && !defined TORRENT_DISABLE_POOL_ALLOCATOR -#error TORRENT_DEBUG_BUFFERS only works if you also disable pool allocators +#error TORRENT_DEBUG_BUFFERS only works if you also disable pool allocators with TORRENT_DISABLE_POOL_ALLOCATOR +#endif + +#if !defined BOOST_ASIO_SEPARATE_COMPILATION && !defined BOOST_ASIO_DYN_LINK +#error you must define either BOOST_ASIO_SEPARATE_COMPILATION or BOOST_ASIO_DYN_LINK in your project in \ + order for asio's declarations to be correct. If you're linking dynamically against libtorrent, define \ + BOOST_ASIO_DYN_LINK otherwise BOOST_ASIO_SEPARATE_COMPILATION. You can also use pkg-config or boost \ + build, to automatically apply these defines #endif #ifndef _MSC_VER diff --git a/include/libtorrent/session.hpp b/include/libtorrent/session.hpp index 665a48f77..ab3f0a662 100644 --- a/include/libtorrent/session.hpp +++ b/include/libtorrent/session.hpp @@ -57,6 +57,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/alert.hpp" // alert::error_notification #include "libtorrent/add_torrent_params.hpp" #include "libtorrent/rss.hpp" +#include "libtorrent/build_config.hpp" #include "libtorrent/storage.hpp" @@ -86,6 +87,10 @@ namespace libtorrent TORRENT_EXPORT session_settings min_memory_usage(); TORRENT_EXPORT session_settings high_performance_seed(); +#ifndef TORRENT_CFG +#error TORRENT_CFG is not defined! +#endif + void TORRENT_EXPORT TORRENT_CFG(); namespace aux diff --git a/src/session.cpp b/src/session.cpp index c4f07372b..ab6283858 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -376,6 +376,10 @@ namespace libtorrent m_impl->m_io_service.post(boost::bind(&fun_ret, &r, &done, &m_impl->cond, &m_impl->mut, boost::function(boost::bind(&session_impl:: x, m_impl.get(), a1, a2, a3)))); \ TORRENT_WAIT +#ifndef TORRENT_CFG +#error TORRENT_CFG is not defined! +#endif + // this is a dummy function that's exported and named based // on the configuration. The session.hpp file will reference // it and if the library and the client are built with different