From f41ceab27cceaf2cf3e448511f2a9a4ee8301866 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 24 Jun 2013 00:14:17 +0000 Subject: [PATCH] fix dynamic link issue with libtorrent_error_category --- include/libtorrent/error_code.hpp | 13 ++----------- src/error_code.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/libtorrent/error_code.hpp b/include/libtorrent/error_code.hpp index bcd43e58c..4c230c5ba 100644 --- a/include/libtorrent/error_code.hpp +++ b/include/libtorrent/error_code.hpp @@ -335,12 +335,6 @@ namespace libtorrent { return boost::system::error_condition(ev, *this); } }; - inline boost::system::error_category& get_libtorrent_category() - { - static libtorrent_error_category libtorrent_category; - return libtorrent_category; - } - struct TORRENT_EXPORT http_error_category : boost::system::error_category { virtual const char* name() const throw(); @@ -349,11 +343,8 @@ namespace libtorrent { return boost::system::error_condition(ev, *this); } }; - inline boost::system::error_category& get_http_category() - { - static http_error_category http_category; - return http_category; - } + TORRENT_EXPORT boost::system::error_category& get_libtorrent_category(); + TORRENT_EXPORT boost::system::error_category& get_http_category(); namespace errors { diff --git a/src/error_code.cpp b/src/error_code.cpp index 17cb14494..c0950583b 100644 --- a/src/error_code.cpp +++ b/src/error_code.cpp @@ -263,6 +263,18 @@ namespace libtorrent return msgs[ev]; } + boost::system::error_category& get_libtorrent_category() + { + static libtorrent_error_category libtorrent_category; + return libtorrent_category; + } + + boost::system::error_category& get_http_category() + { + static http_error_category http_category; + return http_category; + } + const char* http_error_category::name() const throw() { return "http error";