moved the error_category to error_code.cpp and added the new files (error_code.{hpp|.cpp}) to the Jamfile and makefiles

This commit is contained in:
Arvid Norberg
2008-07-18 10:22:16 +00:00
parent 429a118dd2
commit 2ab80ddc3a
5 changed files with 26 additions and 32 deletions

View File

@@ -17,6 +17,7 @@ libtorrent/disk_io_thread.hpp \
libtorrent/entry.hpp \
libtorrent/enum_net.hpp \
libtorrent/escape_string.hpp \
libtorrent/error_code.hpp \
libtorrent/extensions.hpp \
libtorrent/file.hpp \
libtorrent/file_pool.hpp \

View File

@@ -43,10 +43,31 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent
{
namespace errors
{
enum error_code_enum
{
no_error = 0,
file_collision
};
}
#if BOOST_VERSION < 103500
typedef asio::error_code error_code;
inline asio::error::error_category get_posix_category() { return asio::error::system_category; }
#else
struct libtorrent_error_category : boost::system::error_category
{
virtual const char* name() const;
virtual std::string message(int ev) const;
virtual boost::system::error_condition default_error_condition(int ev) const
{ return boost::system::error_condition(ev, *this); }
};
extern libtorrent_error_category libtorrent_category;
using boost::system::error_code;
inline boost::system::error_category const& get_posix_category()
{ return boost::system::get_posix_category(); }