1 | |
2 | // Copyright 2019 Peter Dimov. |
3 | // Distributed under the Boost Software License, Version 1.0. |
4 | |
5 | #include <boost/system/error_code.hpp> |
6 | #include <boost/config/pragma_message.hpp> |
7 | #include <boost/config/helper_macros.hpp> |
8 | |
9 | #if defined(STD_SINGLE_INSTANCE_SHARED) && defined(__CYGWIN__) |
10 | |
11 | BOOST_PRAGMA_MESSAGE( "Skipping Windows/DLL test, __CYGWIN__" ) |
12 | int main() {} |
13 | |
14 | #elif defined(STD_SINGLE_INSTANCE_SHARED) && defined(_WIN32) && !defined(_MSC_VER) |
15 | |
16 | BOOST_PRAGMA_MESSAGE( "Skipping Windows/DLL test, no _MSC_VER" ) |
17 | int main() {} |
18 | |
19 | #elif defined(STD_SINGLE_INSTANCE_SHARED) && defined(_WIN32) && !defined(_CPPLIB_VER) |
20 | |
21 | BOOST_PRAGMA_MESSAGE( "Skipping Windows/DLL test, no _CPPLIB_VER" ) |
22 | int main() {} |
23 | |
24 | #elif defined(STD_SINGLE_INSTANCE_SHARED) && defined(_WIN32) && (_MSC_VER < 1900 || _MSC_VER >= 2000) |
25 | |
26 | BOOST_PRAGMA_MESSAGE( "Skipping Windows/DLL test, _MSC_VER is " BOOST_STRINGIZE(_MSC_VER) ) |
27 | int main() {} |
28 | |
29 | #else |
30 | |
31 | #include <boost/core/lightweight_test.hpp> |
32 | #include <system_error> |
33 | |
34 | using namespace boost::system; |
35 | |
36 | namespace lib1 |
37 | { |
38 | |
39 | std::error_code get_system_code(); |
40 | std::error_code get_generic_code(); |
41 | |
42 | } // namespace lib1 |
43 | |
44 | namespace lib2 |
45 | { |
46 | |
47 | std::error_code get_system_code(); |
48 | std::error_code get_generic_code(); |
49 | |
50 | } // namespace lib2 |
51 | |
52 | int main() |
53 | { |
54 | { |
55 | std::error_code e1 = lib1::get_system_code(); |
56 | std::error_code e2 = lib2::get_system_code(); |
57 | |
58 | BOOST_TEST_EQ( e1, e2 ); |
59 | } |
60 | |
61 | { |
62 | std::error_code e1 = lib1::get_generic_code(); |
63 | std::error_code e2 = lib2::get_generic_code(); |
64 | |
65 | BOOST_TEST_EQ( e1, e2 ); |
66 | } |
67 | |
68 | return boost::report_errors(); |
69 | } |
70 | |
71 | #endif |
72 | |