diff --git a/build/has_windbg_cached.cpp b/build/has_windbg_cached.cpp index d1c2375..d8fe42b 100644 --- a/build/has_windbg_cached.cpp +++ b/build/has_windbg_cached.cpp @@ -4,13 +4,18 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +#include #include #include #include "dbgeng.h" int foo() { +#ifndef BOOST_NO_CXX11_THREAD_LOCAL static thread_local int i = 0; - +#else + static __declspec(thread) int i = 0; +#endif + return i; } diff --git a/include/boost/stacktrace/detail/frame_msvc.ipp b/include/boost/stacktrace/detail/frame_msvc.ipp index 871d141..0ce6f3b 100644 --- a/include/boost/stacktrace/detail/frame_msvc.ipp +++ b/include/boost/stacktrace/detail/frame_msvc.ipp @@ -166,8 +166,13 @@ public: static com_holder< ::IDebugSymbols>& get_thread_local_debug_inst() BOOST_NOEXCEPT { // [class.mfct]: A static local variable or local type in a member function always refers to the same entity, whether // or not the member function is inline. +#ifndef BOOST_NO_CXX11_THREAD_LOCAL static thread_local boost::stacktrace::detail::com_global_initer com; static thread_local com_holder< ::IDebugSymbols> idebug(com); +#else + static __declspec(thread) boost::stacktrace::detail::com_global_initer com; + static __declspec(thread) com_holder< ::IDebugSymbols> idebug(com); +#endif if (!idebug.is_inited()) { try_init_com(idebug, com);