Skip to content

Commit dab80b9

Browse files
committed
Changed so_dll_test to use throw_exception from lightweight_test.hpp, which is now marked as inline. Added a static version of so_dll_test, to ensure lack of multiply defined symbols errors across all compilers when Windows TLS is used
1 parent 7f2847a commit dab80b9

File tree

3 files changed

+4
-36
lines changed

3 files changed

+4
-36
lines changed

test/lightweight_test.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
#ifdef BOOST_LEAF_NO_EXCEPTIONS
99
namespace boost
1010
{
11-
[[noreturn]] void throw_exception( std::exception const & e )
11+
[[noreturn]] inline void throw_exception( std::exception const & e )
1212
{
1313
std::cerr << "Terminating due to a C++ exception under BOOST_LEAF_NO_EXCEPTIONS: " << e.what();
1414
std::terminate();
1515
}
1616

1717
struct source_location;
18-
[[noreturn]] void throw_exception( std::exception const & e, boost::source_location const & )
18+
[[noreturn]] inline void throw_exception( std::exception const & e, boost::source_location const & )
1919
{
2020
throw_exception(e);
2121
}

test/so_dll_lib1.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,7 @@
1010
# include <boost/leaf/on_error.hpp>
1111
#endif
1212

13-
#ifdef BOOST_LEAF_NO_EXCEPTIONS
14-
#include <iostream>
15-
namespace boost
16-
{
17-
[[noreturn]] inline void throw_exception( std::exception const & e )
18-
{
19-
std::cerr << "Terminating due to a C++ exception under BOOST_LEAF_NO_EXCEPTIONS: " << e.what();
20-
std::terminate();
21-
}
22-
23-
struct source_location;
24-
[[noreturn]] inline void throw_exception( std::exception const & e, boost::source_location const & )
25-
{
26-
throw_exception(e);
27-
}
28-
}
29-
#endif
13+
#include "lightweight_test.hpp"
3014

3115
#define BOOST_LEAF_SO_DLL_TEST_BUILDING_LIB1
3216

test/so_dll_lib2.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,7 @@
1010
# include <boost/leaf/on_error.hpp>
1111
#endif
1212

13-
#ifdef BOOST_LEAF_NO_EXCEPTIONS
14-
#include <iostream>
15-
namespace boost
16-
{
17-
[[noreturn]] inline void throw_exception( std::exception const & e )
18-
{
19-
std::cerr << "Terminating due to a C++ exception under BOOST_LEAF_NO_EXCEPTIONS: " << e.what();
20-
std::terminate();
21-
}
22-
23-
struct source_location;
24-
[[noreturn]] inline void throw_exception( std::exception const & e, boost::source_location const & )
25-
{
26-
throw_exception(e);
27-
}
28-
}
29-
#endif
13+
#include "lightweight_test.hpp"
3014

3115
#define BOOST_LEAF_SO_DLL_TEST_BUILDING_LIB2
3216

0 commit comments

Comments
 (0)