diff --git a/build/Jamfile.v2 b/build/Jamfile.v2
index 9f93887..261947a 100644
--- a/build/Jamfile.v2
+++ b/build/Jamfile.v2
@@ -180,4 +180,5 @@ lib boost_stacktrace_from_exception
: # usage-requirements
#shared:BOOST_STACKTRACE_DYN_LINK=1
BOOST_STACKTRACE_NO_LIB=1
+ BOOST_STACKTRACE_LINKED_WITH_FROM_EXCEPTION=1
;
diff --git a/include/boost/stacktrace/stacktrace.hpp b/include/boost/stacktrace/stacktrace.hpp
index 5592eba..f9ad1dd 100644
--- a/include/boost/stacktrace/stacktrace.hpp
+++ b/include/boost/stacktrace/stacktrace.hpp
@@ -37,15 +37,18 @@
extern "C" {
-//#if defined(BOOST_STACKTRACE_LINK) && defined(BOOST_STACKTRACE_DYN_LINK)
-BOOST_SYMBOL_EXPORT
-//#endif
-inline void* boost_stacktrace_impl_return_nullptr() { return nullptr; }
const char* boost_stacktrace_impl_current_exception_stacktrace();
bool* boost_stacktrace_impl_ref_capture_stacktraces_at_throw();
}
+#ifndef BOOST_STACKTRACE_LINKED_WITH_FROM_EXCEPTION
+
+extern "C" {
+BOOST_SYMBOL_EXPORT
+inline void* boost_stacktrace_impl_return_nullptr() { return nullptr; }
+}
+
#ifdef _M_IX86
# pragma comment(linker, "/ALTERNATENAME:_boost_stacktrace_impl_current_exception_stacktrace=_boost_stacktrace_impl_return_nullptr")
# pragma comment(linker, "/ALTERNATENAME:_boost_stacktrace_impl_ref_capture_stacktraces_at_throw=_boost_stacktrace_impl_return_nullptr")
@@ -54,6 +57,8 @@ bool* boost_stacktrace_impl_ref_capture_stacktraces_at_throw();
# pragma comment(linker, "/ALTERNATENAME:boost_stacktrace_impl_ref_capture_stacktraces_at_throw=boost_stacktrace_impl_return_nullptr")
#endif
+#endif // #ifndef BOOST_STACKTRACE_LINKED_WITH_FROM_EXCEPTION
+
#endif
namespace boost { namespace stacktrace {