From 77dcc5363ff494e9571c275ed2be5f9e6dfb8b4c Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 28 May 2017 00:17:36 -0400 Subject: [PATCH] fix build with exceptions disabled --- include/libtorrent/aux_/throw.hpp | 11 ++++++----- include/libtorrent/error_code.hpp | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/libtorrent/aux_/throw.hpp b/include/libtorrent/aux_/throw.hpp index f653fe01d..f43f954f2 100644 --- a/include/libtorrent/aux_/throw.hpp +++ b/include/libtorrent/aux_/throw.hpp @@ -40,14 +40,15 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { namespace aux { template - void TORRENT_NO_RETURN throw_ex(Args&&... args) - { #ifdef BOOST_NO_EXCEPTIONS + void TORRENT_NO_RETURN throw_ex(Args&&...) { std::terminate(); -#else - throw T(std::forward(args)...); -#endif } +#else + void TORRENT_NO_RETURN throw_ex(Args&&... args) { + throw T(std::forward(args)...); + } +#endif }} #endif diff --git a/include/libtorrent/error_code.hpp b/include/libtorrent/error_code.hpp index 56fabce5c..9589070bb 100644 --- a/include/libtorrent/error_code.hpp +++ b/include/libtorrent/error_code.hpp @@ -483,12 +483,11 @@ namespace libtorrent { using boost::system::generic_category; using boost::system::system_category; -#ifndef BOOST_NO_EXCEPTIONS using boost::system::system_error; -#ifndef TORRENT_NO_DEPRECATE - using system_error = boost::system::system_error; +#ifndef BOOST_NO_EXCEPTIONS +#ifndef TORRENT_NO_DEPRECATE TORRENT_DEPRECATED inline boost::system::error_category& get_libtorrent_category() { return libtorrent_category(); }