mirror of
https://github.com/boostorg/system.git
synced 2025-07-29 20:17:13 +02:00
Remove uses of BOOST_SYSTEM_HAS_SYSTEM_ERROR
This commit is contained in:
@ -17,10 +17,6 @@
|
||||
//
|
||||
// https://github.com/boostorg/system/issues/92
|
||||
|
||||
// BOOST_SYSTEM_HAS_SYSTEM_ERROR
|
||||
|
||||
#define BOOST_SYSTEM_HAS_SYSTEM_ERROR
|
||||
|
||||
// BOOST_SYSTEM_NOEXCEPT
|
||||
// Retained for backward compatibility
|
||||
|
||||
|
@ -17,11 +17,8 @@
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include <cstddef>
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
# include <system_error>
|
||||
# include <atomic>
|
||||
#endif
|
||||
#include <system_error>
|
||||
#include <atomic>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@ -81,16 +78,8 @@ private:
|
||||
void const* stdcat_align_;
|
||||
};
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
mutable std::atomic< unsigned > sc_init_;
|
||||
|
||||
#else
|
||||
|
||||
unsigned sc_init_;
|
||||
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
~error_category() = default;
|
||||
@ -156,8 +145,6 @@ public:
|
||||
return std::less<error_category const *>()( &lhs, &rhs );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
void init_stdcat() const;
|
||||
|
||||
# if defined(__SUNPRO_CC) // trailing __global is not supported
|
||||
@ -165,8 +152,6 @@ public:
|
||||
# else
|
||||
operator std::error_category const & () const BOOST_SYMBOL_VISIBLE;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(BOOST_MSVC) && BOOST_MSVC < 1900
|
||||
|
@ -75,8 +75,6 @@ inline char const * error_category::message( int ev, char * buffer, std::size_t
|
||||
|
||||
// interoperability with std::error_code, std::error_condition
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
#include <boost/system/detail/std_category_impl.hpp>
|
||||
#include <boost/system/detail/mutex.hpp>
|
||||
#include <new>
|
||||
@ -165,6 +163,4 @@ inline BOOST_NOINLINE error_category::operator std::error_category const & () co
|
||||
} // namespace system
|
||||
} // namespace boost
|
||||
|
||||
#endif // #if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
#endif // #ifndef BOOST_SYSTEM_DETAIL_ERROR_CATEGORY_IMPL_HPP_INCLUDED
|
||||
|
@ -21,11 +21,7 @@
|
||||
#include <boost/system/detail/append_int.hpp>
|
||||
#include <boost/system/detail/snprintf.hpp>
|
||||
#include <boost/system/detail/config.hpp>
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
# include <boost/system/detail/std_category.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/system/detail/std_category.hpp>
|
||||
#include <boost/assert/source_location.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/config.hpp>
|
||||
@ -33,10 +29,7 @@
|
||||
#include <ostream>
|
||||
#include <new>
|
||||
#include <cstdio>
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
# include <system_error>
|
||||
#endif
|
||||
#include <system_error>
|
||||
|
||||
#if defined(BOOST_GCC) && BOOST_GCC >= 40600 && BOOST_GCC < 70000
|
||||
# pragma GCC diagnostic push
|
||||
@ -79,9 +72,7 @@ private:
|
||||
union
|
||||
{
|
||||
data d1_;
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
unsigned char d2_[ sizeof(std::error_code) ];
|
||||
#endif
|
||||
};
|
||||
|
||||
// 0: default constructed, d1_ value initialized
|
||||
@ -142,9 +133,7 @@ public:
|
||||
template<class ErrorCodeEnum> BOOST_SYSTEM_CONSTEXPR error_code( ErrorCodeEnum e,
|
||||
typename detail::enable_if<
|
||||
is_error_code_enum<ErrorCodeEnum>::value
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|| std::is_error_code_enum<ErrorCodeEnum>::value
|
||||
#endif
|
||||
>::type* = 0 ) BOOST_NOEXCEPT: d1_(), lc_flags_( 0 )
|
||||
{
|
||||
*this = make_error_code( e );
|
||||
@ -161,8 +150,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
error_code( std::error_code const& ec ) BOOST_NOEXCEPT:
|
||||
d1_(), lc_flags_( 0 )
|
||||
{
|
||||
@ -181,8 +168,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// modifiers:
|
||||
|
||||
BOOST_SYSTEM_CONSTEXPR void assign( int val, const error_category & cat ) BOOST_NOEXCEPT
|
||||
@ -223,18 +208,12 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
std::error_code const& ec = *reinterpret_cast<std::error_code const*>( d2_ );
|
||||
|
||||
unsigned cv = static_cast<unsigned>( ec.value() );
|
||||
unsigned ch = static_cast<unsigned>( reinterpret_cast<boost::uintptr_t>( &ec.category() ) % 2097143 ); // 2^21-9, prime
|
||||
|
||||
return static_cast<int>( cv + 1000 * ch );
|
||||
#else
|
||||
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -262,17 +241,12 @@ public:
|
||||
|
||||
std::string message() const
|
||||
{
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
if( lc_flags_ == 1 )
|
||||
{
|
||||
std::error_code const& ec = *reinterpret_cast<std::error_code const*>( d2_ );
|
||||
return ec.message();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if( lc_flags_ == 0 )
|
||||
else if( lc_flags_ == 0 )
|
||||
{
|
||||
return detail::system_error_category_message( value() );
|
||||
}
|
||||
@ -284,7 +258,6 @@ public:
|
||||
|
||||
char const * message( char * buffer, std::size_t len ) const BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
if( lc_flags_ == 1 )
|
||||
{
|
||||
std::error_code const& ec = *reinterpret_cast<std::error_code const*>( d2_ );
|
||||
@ -304,9 +277,7 @@ public:
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if( lc_flags_ == 0 )
|
||||
else if( lc_flags_ == 0 )
|
||||
{
|
||||
return detail::system_error_category_message( value(), buffer, len );
|
||||
}
|
||||
@ -320,13 +291,12 @@ public:
|
||||
{
|
||||
if( lc_flags_ & 1 )
|
||||
{
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
if( lc_flags_ == 1 )
|
||||
{
|
||||
std::error_code const& ec = *reinterpret_cast<std::error_code const*>( d2_ );
|
||||
return ec.value() != 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -382,8 +352,6 @@ public:
|
||||
|
||||
BOOST_SYSTEM_CONSTEXPR inline friend bool operator==( const error_code & lhs, const error_code & rhs ) BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
bool s1 = lhs.lc_flags_ == 1;
|
||||
bool s2 = rhs.lc_flags_ == 1;
|
||||
|
||||
@ -397,7 +365,6 @@ public:
|
||||
return e1 == e2;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
return lhs.value() == rhs.value() && lhs.category() == rhs.category();
|
||||
}
|
||||
@ -405,8 +372,6 @@ public:
|
||||
|
||||
BOOST_SYSTEM_CONSTEXPR inline friend bool operator<( const error_code & lhs, const error_code & rhs ) BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
bool s1 = lhs.lc_flags_ == 1;
|
||||
bool s2 = rhs.lc_flags_ == 1;
|
||||
|
||||
@ -421,7 +386,6 @@ public:
|
||||
return e1 < e2;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
return lhs.category() < rhs.category() || (lhs.category() == rhs.category() && lhs.value() < rhs.value());
|
||||
}
|
||||
@ -432,8 +396,6 @@ public:
|
||||
return !( lhs == rhs );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
inline friend bool operator==( std::error_code const & lhs, error_code const & rhs ) BOOST_NOEXCEPT
|
||||
{
|
||||
return lhs == static_cast< std::error_code >( rhs );
|
||||
@ -582,14 +544,10 @@ public:
|
||||
class E = typename std::enable_if<std::is_same<T, std::error_code>::value>::type>
|
||||
operator T const& () = delete;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
std::string to_string() const
|
||||
{
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
if( lc_flags_ == 1 )
|
||||
{
|
||||
std::error_code const& e2 = *reinterpret_cast<std::error_code const*>( d2_ );
|
||||
@ -601,7 +559,6 @@ public:
|
||||
return r;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
std::string r = category_name();
|
||||
detail::append_int( r, value() );
|
||||
@ -636,15 +593,11 @@ public:
|
||||
|
||||
inline bool operator==( const error_code & code, const error_condition & condition ) BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
if( code.lc_flags_ == 1 )
|
||||
{
|
||||
return static_cast<std::error_code>( code ) == static_cast<std::error_condition>( condition );
|
||||
}
|
||||
else
|
||||
|
||||
#endif
|
||||
{
|
||||
return code.category().equivalent( code.value(), condition ) || condition.category().equivalent( code, condition.value() );
|
||||
}
|
||||
@ -667,16 +620,12 @@ inline bool operator!=( const error_condition & lhs, const error_code & rhs ) BO
|
||||
|
||||
inline std::size_t hash_value( error_code const & ec )
|
||||
{
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
if( ec.lc_flags_ == 1 )
|
||||
{
|
||||
std::error_code const& e2 = *reinterpret_cast<std::error_code const*>( ec.d2_ );
|
||||
return std::hash<std::error_code>()( e2 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
error_category const & cat = ec.category();
|
||||
|
||||
boost::ulong_long_type id_ = cat.id_;
|
||||
|
@ -199,8 +199,6 @@ public:
|
||||
return !( lhs == rhs );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
operator std::error_condition () const
|
||||
{
|
||||
// This condition must be the same as the one in error_category_impl.hpp
|
||||
@ -294,8 +292,6 @@ public:
|
||||
return !( lhs == rhs );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
std::string to_string() const
|
||||
{
|
||||
std::string r( "cond:" );
|
||||
|
@ -7,9 +7,7 @@
|
||||
#include <boost/system/system_category.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cerrno>
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
#include <system_error>
|
||||
#endif
|
||||
|
||||
namespace sys = boost::system;
|
||||
|
||||
@ -69,8 +67,6 @@ int main()
|
||||
BOOST_TEST( e2 == e3 || hash_value( e2 ) != hash_value( e3 ) );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
// std:: wrapping against normal
|
||||
{
|
||||
std::error_code e1( EINVAL, std::generic_category() );
|
||||
@ -126,7 +122,5 @@ int main()
|
||||
BOOST_TEST( e2 == e3 || hash_value( e2 ) != hash_value( e3 ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -85,8 +85,6 @@ int main()
|
||||
BOOST_TEST_EQ( ec.location().line(), 75 );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
{
|
||||
std::error_code e2( val, std::generic_category() );
|
||||
|
||||
@ -107,10 +105,8 @@ int main()
|
||||
BOOST_TEST( ec.failed() );
|
||||
|
||||
BOOST_TEST( ec.has_location() );
|
||||
BOOST_TEST_EQ( ec.location().line(), 100 );
|
||||
BOOST_TEST_EQ( ec.location().line(), 98 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -32,8 +32,6 @@ sys::error_code make_error_code( E e )
|
||||
return e == 0? sys::error_code(): sys::error_code( e, sys::generic_category() );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
enum E2
|
||||
{
|
||||
e2inval = EINVAL
|
||||
@ -57,8 +55,6 @@ std::error_code make_error_code( E2 e )
|
||||
return std::error_code( e, std::generic_category() );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
@ -84,7 +80,7 @@ int main()
|
||||
BOOST_TEST( ec.failed() );
|
||||
|
||||
BOOST_TEST( ec.has_location() );
|
||||
BOOST_TEST_EQ( ec.location().line(), 77 );
|
||||
BOOST_TEST_EQ( ec.location().line(), 73 );
|
||||
}
|
||||
|
||||
{
|
||||
@ -134,7 +130,7 @@ int main()
|
||||
BOOST_TEST( ec.failed() );
|
||||
|
||||
BOOST_TEST( ec.has_location() );
|
||||
BOOST_TEST_EQ( ec.location().line(), 127 );
|
||||
BOOST_TEST_EQ( ec.location().line(), 123 );
|
||||
}
|
||||
|
||||
{
|
||||
@ -182,7 +178,7 @@ int main()
|
||||
BOOST_TEST( ec.failed() );
|
||||
|
||||
BOOST_TEST( ec.has_location() );
|
||||
BOOST_TEST_EQ( ec.location().line(), 175 );
|
||||
BOOST_TEST_EQ( ec.location().line(), 171 );
|
||||
}
|
||||
|
||||
{
|
||||
@ -209,8 +205,6 @@ int main()
|
||||
BOOST_TEST_EQ( ec.location().line(), 0 );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
{
|
||||
sys::error_code ec( e2inval );
|
||||
|
||||
@ -281,7 +275,5 @@ int main()
|
||||
BOOST_TEST_EQ( ec.location().line(), 0 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -57,8 +57,6 @@ int main()
|
||||
BOOST_TEST_EQ( ec3.location(), boost::source_location() );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
{
|
||||
std::error_code e2( val, std::generic_category() );
|
||||
|
||||
@ -84,7 +82,5 @@ int main()
|
||||
BOOST_TEST_EQ( ec3.location(), boost::source_location() );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -59,8 +59,6 @@ int main()
|
||||
BOOST_TEST_EQ( ec.location(), boost::source_location() );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
{
|
||||
std::error_code e2( val, std::generic_category() );
|
||||
|
||||
@ -87,7 +85,5 @@ int main()
|
||||
BOOST_TEST_EQ( ec.location(), boost::source_location() );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -62,8 +62,6 @@ int main()
|
||||
BOOST_TEST_EQ( ec.what(), ec.message() + " [system:5 at " + loc.to_string() + "]" );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
{
|
||||
std::error_code ec;
|
||||
sys::error_code ec2( ec );
|
||||
@ -85,7 +83,5 @@ int main()
|
||||
BOOST_TEST_EQ( ec2.what(), ec2.message() + " [std:system:5]" );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -30,8 +30,6 @@ int main()
|
||||
BOOST_TEST_EQ( r.error(), ec );
|
||||
}
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
{
|
||||
auto ec = make_error_code( std::errc::invalid_argument );
|
||||
|
||||
@ -43,7 +41,5 @@ int main()
|
||||
BOOST_TEST_EQ( r.error(), ec );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -9,23 +9,6 @@
|
||||
// See library home page at http://www.boost.org/libs/system
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <iostream>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout
|
||||
<< "The version of the C++ standard library being used does not"
|
||||
" support header <system_error> so interoperation will not be tested.\n";
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/core/snprintf.hpp>
|
||||
#include <system_error>
|
||||
@ -337,9 +320,6 @@ static void test_user2_category()
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout
|
||||
<< "The version of the C++ standard library being used"
|
||||
" supports header <system_error> so interoperation will be tested.\n";
|
||||
test_generic_category();
|
||||
test_system_category();
|
||||
test_user_category();
|
||||
@ -347,5 +327,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -4,16 +4,7 @@
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
int main()
|
||||
@ -62,5 +53,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -8,12 +8,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <ios>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined" )
|
||||
int main() {}
|
||||
|
||||
#elif defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50000
|
||||
#if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50000
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_LIBSTDCXX_VERSION < 50000" )
|
||||
int main() {}
|
||||
|
@ -6,17 +6,8 @@
|
||||
#include <boost/system/error_category.hpp>
|
||||
#include <boost/system/errc.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
enum my_errc
|
||||
@ -123,5 +114,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -5,17 +5,8 @@
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/system/error_category.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
class my_category_impl: public std::error_category
|
||||
@ -73,5 +64,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -5,17 +5,8 @@
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/system/error_category.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
class my_category_impl: public boost::system::error_category
|
||||
@ -53,5 +44,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -9,12 +9,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#elif defined(BOOST_SYSTEM_AVOID_STD_GENERIC_CATEGORY)
|
||||
#if defined(BOOST_SYSTEM_AVOID_STD_GENERIC_CATEGORY)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_SYSTEM_AVOID_STD_GENERIC_CATEGORY is defined" )
|
||||
int main() {}
|
||||
|
@ -3,15 +3,6 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/system/error_category.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/core/snprintf.hpp>
|
||||
#include <system_error>
|
||||
@ -53,5 +44,3 @@ int main()
|
||||
BOOST_TEST_CSTR_EQ( cat.name(), "user" );
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -6,16 +6,7 @@
|
||||
#include <boost/system/system_category.hpp>
|
||||
#include <boost/system/generic_category.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
void f1( std::error_code ec, int value, std::error_category const& category )
|
||||
@ -94,5 +85,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -4,16 +4,7 @@
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
int main()
|
||||
@ -75,5 +66,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -4,16 +4,7 @@
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
void f( std::error_code& e1, std::error_code e2 )
|
||||
@ -85,5 +76,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -4,16 +4,7 @@
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
int main()
|
||||
@ -104,5 +95,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -4,16 +4,7 @@
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
int main()
|
||||
@ -136,5 +127,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -4,17 +4,8 @@
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
int main()
|
||||
@ -48,5 +39,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -4,17 +4,8 @@
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
enum my_errc
|
||||
@ -78,5 +69,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -4,17 +4,8 @@
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
#include <system_error>
|
||||
|
||||
enum my_errc
|
||||
@ -73,5 +64,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -12,24 +12,8 @@
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <iostream>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout
|
||||
<< "The version of the C++ standard library being used does not"
|
||||
" support header <system_error> so interoperation will not be tested.\n";
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <system_error>
|
||||
#include <cerrno>
|
||||
#include <string>
|
||||
@ -53,14 +37,8 @@ static void test_system_category()
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout
|
||||
<< "The version of the C++ standard library being used"
|
||||
" supports header <system_error> so interoperation will be tested.\n";
|
||||
|
||||
test_generic_category();
|
||||
test_system_category();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -11,9 +11,6 @@
|
||||
#endif
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
#include <system_error>
|
||||
|
||||
namespace lib1
|
||||
@ -30,11 +27,3 @@ EXPORT std::error_code get_generic_code()
|
||||
}
|
||||
|
||||
} // namespace lib1
|
||||
|
||||
#else
|
||||
|
||||
EXPORT void lib1_f()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -11,9 +11,6 @@
|
||||
#endif
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
|
||||
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
#include <system_error>
|
||||
|
||||
namespace lib2
|
||||
@ -30,11 +27,3 @@ EXPORT std::error_code get_generic_code()
|
||||
}
|
||||
|
||||
} // namespace lib2
|
||||
|
||||
#else
|
||||
|
||||
EXPORT void lib2_f()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -6,12 +6,7 @@
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <boost/config/helper_macros.hpp>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||||
int main() {}
|
||||
|
||||
#elif defined(STD_SINGLE_INSTANCE_SHARED) && defined(__CYGWIN__)
|
||||
#if defined(STD_SINGLE_INSTANCE_SHARED) && defined(__CYGWIN__)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "Skipping Windows/DLL test, __CYGWIN__" )
|
||||
int main() {}
|
||||
|
@ -6,12 +6,7 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_SYSTEM_HAS_SYSTEM_ERROR is not defined" )
|
||||
int main() {}
|
||||
|
||||
#elif !defined(BOOST_MSSTL_VERSION) || BOOST_MSSTL_VERSION < 140
|
||||
#if !defined(BOOST_MSSTL_VERSION) || BOOST_MSSTL_VERSION < 140
|
||||
|
||||
BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_MSSTL_VERSION is not defined or is less than 140" )
|
||||
int main() {}
|
||||
|
Reference in New Issue
Block a user