mirror of
https://github.com/boostorg/leaf.git
synced 2026-01-26 06:32:23 +00:00
Significant refactoring:
- Support for error objects crossing DLL boundaries on Windows via BOOST_LEAF_CFG_WIN32=2. - Internal TLS interface improvements, separating logical allocation from reading. - Dynamic allocations (if enabled) for on_error objects now happens before stack unwinding begins. - BOOST_LEAF_SYMBOL_VISIBLE declarations now separated in config/visibility.hpp.
This commit is contained in:
@@ -14,7 +14,7 @@ int main()
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
#else // #if !BOOST_LEAF_CFG_STD_SYSTEM_ERROR
|
||||
|
||||
#ifdef BOOST_LEAF_TEST_SINGLE_HEADER
|
||||
# include "leaf.hpp"
|
||||
@@ -27,10 +27,12 @@ int main()
|
||||
#include "_test_res.hpp"
|
||||
#include "lightweight_test.hpp"
|
||||
|
||||
#if BOOST_LEAF_BOOST_AVAILABLE
|
||||
#include "boost/system/result.hpp"
|
||||
namespace boost { namespace leaf {
|
||||
template <class T> struct is_result_type<boost::system::result<T, std::error_code>>: std::true_type { };
|
||||
} }
|
||||
#endif
|
||||
|
||||
namespace leaf = boost::leaf;
|
||||
|
||||
@@ -97,7 +99,7 @@ void test()
|
||||
} );
|
||||
BOOST_TEST_EQ(r, 42);
|
||||
}
|
||||
#endif
|
||||
#endif // #if __cplusplus >= 201703L
|
||||
|
||||
{
|
||||
int r = leaf::try_handle_all(
|
||||
@@ -154,7 +156,7 @@ void test()
|
||||
} );
|
||||
BOOST_TEST_EQ(r, 42);
|
||||
}
|
||||
#endif
|
||||
#endif // #if __cplusplus >= 201703L
|
||||
{
|
||||
int r = leaf::try_handle_all(
|
||||
[]() -> R
|
||||
@@ -212,7 +214,7 @@ void test()
|
||||
} );
|
||||
BOOST_TEST_EQ(r, 42);
|
||||
}
|
||||
#endif
|
||||
#endif // #if __cplusplus >= 201703L
|
||||
|
||||
{
|
||||
int r = leaf::try_handle_all(
|
||||
@@ -271,7 +273,7 @@ void test()
|
||||
} );
|
||||
BOOST_TEST_EQ(r, 42);
|
||||
}
|
||||
#endif
|
||||
#endif // #if __cplusplus >= 201703L
|
||||
{
|
||||
int r = leaf::try_handle_all(
|
||||
[]() -> R
|
||||
@@ -313,7 +315,7 @@ void test()
|
||||
} );
|
||||
BOOST_TEST_EQ(r, 42);
|
||||
}
|
||||
#endif
|
||||
#endif // #if __cplusplus >= 201703L
|
||||
}
|
||||
|
||||
template <class R>
|
||||
@@ -380,7 +382,7 @@ void test_void()
|
||||
} );
|
||||
BOOST_TEST_EQ(r, 42);
|
||||
}
|
||||
#endif
|
||||
#endif // #if __cplusplus >= 201703L
|
||||
|
||||
{
|
||||
int r = 0;
|
||||
@@ -440,7 +442,7 @@ void test_void()
|
||||
} );
|
||||
BOOST_TEST_EQ(r, 42);
|
||||
}
|
||||
#endif
|
||||
#endif // #if __cplusplus >= 201703L
|
||||
{
|
||||
int r = 0;
|
||||
leaf::try_handle_all(
|
||||
@@ -501,7 +503,7 @@ void test_void()
|
||||
} );
|
||||
BOOST_TEST_EQ(r, 42);
|
||||
}
|
||||
#endif
|
||||
#endif // #if __cplusplus >= 201703L
|
||||
|
||||
{
|
||||
int r = 0;
|
||||
@@ -563,7 +565,7 @@ void test_void()
|
||||
} );
|
||||
BOOST_TEST_EQ(r, 42);
|
||||
}
|
||||
#endif
|
||||
#endif // #if __cplusplus >= 201703L
|
||||
{
|
||||
int r = 0;
|
||||
leaf::try_handle_all(
|
||||
@@ -607,7 +609,7 @@ void test_void()
|
||||
} );
|
||||
BOOST_TEST_EQ(r, 42);
|
||||
}
|
||||
#endif
|
||||
#endif // #if __cplusplus >= 201703L
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -616,8 +618,10 @@ int main()
|
||||
test<test_res<int, std::error_code>>();
|
||||
test_void<leaf::result<void>>();
|
||||
test_void<test_res<void, std::error_code>>();
|
||||
#ifdef BOOST_LEAF_BOOST_AVAILABLE
|
||||
test<boost::system::result<int, std::error_code>>();
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // #if !BOOST_LEAF_CFG_STD_SYSTEM_ERROR
|
||||
|
||||
Reference in New Issue
Block a user