diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
index 612d475..c7ce094 100644
--- a/test/Jamfile.v2
+++ b/test/Jamfile.v2
@@ -21,6 +21,9 @@ project
static:BOOST_SYSTEM_STATIC_LINK=1
;
+ lib single_instance_lib1 : single_instance_1.cpp : shared:SINGLE_INSTANCE_DYN_LINK ;
+ lib single_instance_lib2 : single_instance_2.cpp : shared:SINGLE_INSTANCE_DYN_LINK ;
+
rule cxx03 ( properties * )
{
local result ;
@@ -107,6 +110,8 @@ project
[ system-run- std_interop_test.cpp ]
[ system-run std_mismatch_test.cpp ]
[ system-run single_instance_test.cpp single_instance_1.cpp single_instance_2.cpp ]
+ [ run single_instance_test.cpp single_instance_lib1 single_instance_lib2 : : : static : single_instance_lib_static ]
+ [ run single_instance_test.cpp single_instance_lib1 single_instance_lib2 : : : shared : single_instance_lib_shared ]
[ system-run before_main_test.cpp ]
;
diff --git a/test/single_instance_1.cpp b/test/single_instance_1.cpp
index 35a7240..3bee8a8 100644
--- a/test/single_instance_1.cpp
+++ b/test/single_instance_1.cpp
@@ -2,19 +2,26 @@
// Copyright 2018 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
-#include
+#include
+#if defined(SINGLE_INSTANCE_DYN_LINK) && defined(BOOST_HAS_DECLSPEC)
+# define EXPORT __declspec(dllexport)
+#else
+# define EXPORT
+#endif
+
+#include
using namespace boost::system;
namespace lib1
{
-error_code get_system_code()
+EXPORT error_code get_system_code()
{
return error_code( 0, system_category() );
}
-error_code get_generic_code()
+EXPORT error_code get_generic_code()
{
return error_code( 0, generic_category() );
}
diff --git a/test/single_instance_2.cpp b/test/single_instance_2.cpp
index 91cbe24..6a3cc63 100644
--- a/test/single_instance_2.cpp
+++ b/test/single_instance_2.cpp
@@ -2,19 +2,26 @@
// Copyright 2018 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
-#include
+#include
+#if defined(SINGLE_INSTANCE_DYN_LINK) && defined(BOOST_HAS_DECLSPEC)
+# define EXPORT __declspec(dllexport)
+#else
+# define EXPORT
+#endif
+
+#include
using namespace boost::system;
namespace lib2
{
-error_code get_system_code()
+EXPORT error_code get_system_code()
{
return error_code( 0, system_category() );
}
-error_code get_generic_code()
+EXPORT error_code get_generic_code()
{
return error_code( 0, generic_category() );
}