]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/system/test/dynamic_link_test.cpp
1 // dynamic_link_test.cpp -------------------------------------------------------------//
3 // Copyright Beman Dawes 2010
5 // Distributed under the Boost Software License, Version 1.0.
6 // See www.boost.org/LICENSE_1_0.txt
8 // Library home page is www.boost.org/libs/system
10 //--------------------------------------------------------------------------------------//
12 // Dynamic link libraries (DLL's), also know as dynamic shared objects (DSO's),
13 // can cause symbol visability problems unless carefully configured. One of the
14 // manifestations, particularly with GCC, is that a system_error exception thrown from
15 // a DLL or DSO is not caught.
17 // The purpose of this program is to test for that error.
19 //--------------------------------------------------------------------------------------//
21 #include <boost/system/system_error.hpp>
29 BOOST_SYSTEM_DECL
void throw_test();
37 boost::system::throw_test();
39 catch (const boost::system::system_error
& ex
)
41 std::cout
<< " caught boost::system::system_error as expected\n";
42 std::cout
<< " what() reports " << ex
.what() << '\n';
46 catch (const std::runtime_error
& ex
)
48 std::cout
<< " error: caught std::runtime_error instead of boost::system::system_error\n";
49 std::cout
<< " what() reports " << ex
.what() << '\n';
53 std::cout
<< " error: failed to catch boost::system::system_error\n";