summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-10-19 20:22:58 (GMT)
committerTobias Markmann <tm@ayena.de>2014-10-20 13:49:33 (GMT)
commit6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch)
tree2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/system/error_code.hpp
parent38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff)
downloadswift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip
swift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0. Updated our update.sh script to stop on error. Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to missing include of <iostream> with newer Boost. Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/system/error_code.hpp')
-rw-r--r--3rdParty/Boost/src/boost/system/error_code.hpp147
1 files changed, 77 insertions, 70 deletions
diff --git a/3rdParty/Boost/src/boost/system/error_code.hpp b/3rdParty/Boost/src/boost/system/error_code.hpp
index b22775f..d419f37 100644
--- a/3rdParty/Boost/src/boost/system/error_code.hpp
+++ b/3rdParty/Boost/src/boost/system/error_code.hpp
@@ -14,7 +14,6 @@
#include <boost/system/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/assert.hpp>
-#include <boost/operators.hpp>
#include <boost/noncopyable.hpp>
#include <boost/utility/enable_if.hpp>
#include <ostream>
@@ -23,7 +22,7 @@
#include <functional>
// TODO: undef these macros if not already defined
-#include <boost/cerrno.hpp>
+#include <boost/cerrno.hpp>
#if !defined(BOOST_POSIX_API) && !defined(BOOST_WINDOWS_API)
# error BOOST_POSIX_API or BOOST_WINDOWS_API must be defined
@@ -31,6 +30,10 @@
#include <boost/config/abi_prefix.hpp> // must be the last #include
+#ifndef BOOST_SYSTEM_NOEXCEPT
+#define BOOST_SYSTEM_NOEXCEPT BOOST_NOEXCEPT
+#endif
+
namespace boost
{
namespace system
@@ -184,17 +187,17 @@ namespace boost
public:
virtual ~error_category(){}
- virtual const char * name() const = 0;
+ virtual const char * name() const BOOST_SYSTEM_NOEXCEPT = 0;
virtual std::string message( int ev ) const = 0;
- virtual error_condition default_error_condition( int ev ) const;
- virtual bool equivalent( int code,
- const error_condition & condition ) const;
- virtual bool equivalent( const error_code & code,
- int condition ) const;
-
- bool operator==(const error_category & rhs) const { return this == &rhs; }
- bool operator!=(const error_category & rhs) const { return this != &rhs; }
- bool operator<( const error_category & rhs ) const
+ inline virtual error_condition default_error_condition( int ev ) const BOOST_SYSTEM_NOEXCEPT;
+ inline virtual bool equivalent( int code,
+ const error_condition & condition ) const BOOST_SYSTEM_NOEXCEPT;
+ inline virtual bool equivalent( const error_code & code,
+ int condition ) const BOOST_SYSTEM_NOEXCEPT;
+
+ bool operator==(const error_category & rhs) const BOOST_SYSTEM_NOEXCEPT { return this == &rhs; }
+ bool operator!=(const error_category & rhs) const BOOST_SYSTEM_NOEXCEPT { return this != &rhs; }
+ bool operator<( const error_category & rhs ) const BOOST_SYSTEM_NOEXCEPT
{
return std::less<const error_category*>()( this, &rhs );
}
@@ -202,9 +205,13 @@ namespace boost
// predefined error categories -----------------------------------------//
- BOOST_SYSTEM_DECL const error_category & system_category();
- BOOST_SYSTEM_DECL const error_category & generic_category();
-
+# ifdef BOOST_ERROR_CODE_HEADER_ONLY
+ inline const error_category & system_category() BOOST_SYSTEM_NOEXCEPT;
+ inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT;
+#else
+ BOOST_SYSTEM_DECL const error_category & system_category() BOOST_SYSTEM_NOEXCEPT;
+ BOOST_SYSTEM_DECL const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT;
+#endif
// deprecated synonyms --------------------------------------------------//
# ifndef BOOST_SYSTEM_NO_DEPRECATED
@@ -225,52 +232,52 @@ namespace boost
public:
// constructors:
- error_condition() : m_val(0), m_cat(&generic_category()) {}
- error_condition( int val, const error_category & cat ) : m_val(val), m_cat(&cat) {}
+ error_condition() BOOST_SYSTEM_NOEXCEPT : m_val(0), m_cat(&generic_category()) {}
+ error_condition( int val, const error_category & cat ) BOOST_SYSTEM_NOEXCEPT : m_val(val), m_cat(&cat) {}
template <class ErrorConditionEnum>
error_condition(ErrorConditionEnum e,
- typename boost::enable_if<is_error_condition_enum<ErrorConditionEnum> >::type* = 0)
+ typename boost::enable_if<is_error_condition_enum<ErrorConditionEnum> >::type* = 0) BOOST_SYSTEM_NOEXCEPT
{
*this = make_error_condition(e);
}
// modifiers:
- void assign( int val, const error_category & cat )
- {
+ void assign( int val, const error_category & cat ) BOOST_SYSTEM_NOEXCEPT
+ {
m_val = val;
m_cat = &cat;
}
-
+
template<typename ErrorConditionEnum>
typename boost::enable_if<is_error_condition_enum<ErrorConditionEnum>, error_condition>::type &
- operator=( ErrorConditionEnum val )
- {
+ operator=( ErrorConditionEnum val ) BOOST_SYSTEM_NOEXCEPT
+ {
*this = make_error_condition(val);
return *this;
}
- void clear()
+ void clear() BOOST_SYSTEM_NOEXCEPT
{
m_val = 0;
m_cat = &generic_category();
}
// observers:
- int value() const { return m_val; }
- const error_category & category() const { return *m_cat; }
+ int value() const BOOST_SYSTEM_NOEXCEPT { return m_val; }
+ const error_category & category() const BOOST_SYSTEM_NOEXCEPT { return *m_cat; }
std::string message() const { return m_cat->message(value()); }
typedef void (*unspecified_bool_type)();
static void unspecified_bool_true() {}
- operator unspecified_bool_type() const // true if error
- {
+ operator unspecified_bool_type() const BOOST_SYSTEM_NOEXCEPT // true if error
+ {
return m_val == 0 ? 0 : unspecified_bool_true;
}
- bool operator!() const // true if no error
+ bool operator!() const BOOST_SYSTEM_NOEXCEPT // true if no error
{
return m_val == 0;
}
@@ -279,13 +286,13 @@ namespace boost
// the more symmetrical non-member syntax allows enum
// conversions work for both rhs and lhs.
inline friend bool operator==( const error_condition & lhs,
- const error_condition & rhs )
+ const error_condition & rhs ) BOOST_SYSTEM_NOEXCEPT
{
return lhs.m_cat == rhs.m_cat && lhs.m_val == rhs.m_val;
- }
+ }
inline friend bool operator<( const error_condition & lhs,
- const error_condition & rhs )
+ const error_condition & rhs ) BOOST_SYSTEM_NOEXCEPT
// the more symmetrical non-member syntax allows enum
// conversions work for both rhs and lhs.
{
@@ -312,59 +319,59 @@ namespace boost
public:
// constructors:
- error_code() : m_val(0), m_cat(&system_category()) {}
- error_code( int val, const error_category & cat ) : m_val(val), m_cat(&cat) {}
+ error_code() BOOST_SYSTEM_NOEXCEPT : m_val(0), m_cat(&system_category()) {}
+ error_code( int val, const error_category & cat ) BOOST_SYSTEM_NOEXCEPT : m_val(val), m_cat(&cat) {}
template <class ErrorCodeEnum>
error_code(ErrorCodeEnum e,
- typename boost::enable_if<is_error_code_enum<ErrorCodeEnum> >::type* = 0)
+ typename boost::enable_if<is_error_code_enum<ErrorCodeEnum> >::type* = 0) BOOST_SYSTEM_NOEXCEPT
{
*this = make_error_code(e);
}
// modifiers:
- void assign( int val, const error_category & cat )
- {
+ void assign( int val, const error_category & cat ) BOOST_SYSTEM_NOEXCEPT
+ {
m_val = val;
m_cat = &cat;
}
-
+
template<typename ErrorCodeEnum>
typename boost::enable_if<is_error_code_enum<ErrorCodeEnum>, error_code>::type &
- operator=( ErrorCodeEnum val )
- {
+ operator=( ErrorCodeEnum val ) BOOST_SYSTEM_NOEXCEPT
+ {
*this = make_error_code(val);
return *this;
}
- void clear()
+ void clear() BOOST_SYSTEM_NOEXCEPT
{
m_val = 0;
m_cat = &system_category();
}
// observers:
- int value() const { return m_val; }
- const error_category & category() const { return *m_cat; }
- error_condition default_error_condition() const { return m_cat->default_error_condition(value()); }
+ int value() const BOOST_SYSTEM_NOEXCEPT { return m_val; }
+ const error_category & category() const BOOST_SYSTEM_NOEXCEPT { return *m_cat; }
+ error_condition default_error_condition() const BOOST_SYSTEM_NOEXCEPT { return m_cat->default_error_condition(value()); }
std::string message() const { return m_cat->message(value()); }
typedef void (*unspecified_bool_type)();
static void unspecified_bool_true() {}
- operator unspecified_bool_type() const // true if error
- {
+ operator unspecified_bool_type() const BOOST_SYSTEM_NOEXCEPT // true if error
+ {
return m_val == 0 ? 0 : unspecified_bool_true;
}
- bool operator!() const // true if no error
+ bool operator!() const BOOST_SYSTEM_NOEXCEPT // true if no error
{
return m_val == 0;
}
// relationals:
inline friend bool operator==( const error_code & lhs,
- const error_code & rhs )
+ const error_code & rhs ) BOOST_SYSTEM_NOEXCEPT
// the more symmetrical non-member syntax allows enum
// conversions work for both rhs and lhs.
{
@@ -372,15 +379,15 @@ namespace boost
}
inline friend bool operator<( const error_code & lhs,
- const error_code & rhs )
+ const error_code & rhs ) BOOST_SYSTEM_NOEXCEPT
// the more symmetrical non-member syntax allows enum
// conversions work for both rhs and lhs.
{
return lhs.m_cat < rhs.m_cat
|| (lhs.m_cat == rhs.m_cat && lhs.m_val < rhs.m_val);
}
-
- private:
+
+ private:
int m_val;
const error_category * m_cat;
@@ -414,43 +421,43 @@ namespace boost
// non-member functions ------------------------------------------------//
inline bool operator!=( const error_code & lhs,
- const error_code & rhs )
+ const error_code & rhs ) BOOST_SYSTEM_NOEXCEPT
{
return !(lhs == rhs);
}
inline bool operator!=( const error_condition & lhs,
- const error_condition & rhs )
+ const error_condition & rhs ) BOOST_SYSTEM_NOEXCEPT
{
return !(lhs == rhs);
}
inline bool operator==( const error_code & code,
- const error_condition & condition )
+ const error_condition & condition ) BOOST_SYSTEM_NOEXCEPT
{
return code.category().equivalent( code.value(), condition )
|| condition.category().equivalent( code, condition.value() );
}
-
+
inline bool operator!=( const error_code & lhs,
- const error_condition & rhs )
+ const error_condition & rhs ) BOOST_SYSTEM_NOEXCEPT
{
return !(lhs == rhs);
}
-
+
inline bool operator==( const error_condition & condition,
- const error_code & code )
+ const error_code & code ) BOOST_SYSTEM_NOEXCEPT
{
return condition.category().equivalent( code, condition.value() )
|| code.category().equivalent( code.value(), condition );
}
-
+
inline bool operator!=( const error_condition & lhs,
- const error_code & rhs )
+ const error_code & rhs ) BOOST_SYSTEM_NOEXCEPT
{
return !(lhs == rhs);
}
-
+
// TODO: both of these may move elsewhere, but the LWG hasn't spoken yet.
template <class charT, class traits>
@@ -472,29 +479,29 @@ namespace boost
namespace errc
{
// explicit conversion:
- inline error_code make_error_code( errc_t e )
+ inline error_code make_error_code( errc_t e ) BOOST_SYSTEM_NOEXCEPT
{ return error_code( e, generic_category() ); }
// implicit conversion:
- inline error_condition make_error_condition( errc_t e )
+ inline error_condition make_error_condition( errc_t e ) BOOST_SYSTEM_NOEXCEPT
{ return error_condition( e, generic_category() ); }
}
// error_category default implementation -------------------------------//
- inline error_condition error_category::default_error_condition( int ev ) const
- {
+ error_condition error_category::default_error_condition( int ev ) const BOOST_SYSTEM_NOEXCEPT
+ {
return error_condition( ev, *this );
}
- inline bool error_category::equivalent( int code,
- const error_condition & condition ) const
+ bool error_category::equivalent( int code,
+ const error_condition & condition ) const BOOST_SYSTEM_NOEXCEPT
{
return default_error_condition( code ) == condition;
}
- inline bool error_category::equivalent( const error_code & code,
- int condition ) const
+ bool error_category::equivalent( const error_code & code,
+ int condition ) const BOOST_SYSTEM_NOEXCEPT
{
return *this == code.category() && code.value() == condition;
}
@@ -505,7 +512,7 @@ namespace boost
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
# ifdef BOOST_ERROR_CODE_HEADER_ONLY
-# include <boost/../libs/system/src/error_code.cpp>
+# include <boost/system/detail/error_code.ipp>
# endif
#endif // BOOST_ERROR_CODE_HPP