has_windbg_cached.cpp 686 B

12345678910111213141516171819202122232425262728
  1. // Copyright Antony Polukhin, 2016-2019.
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See
  4. // accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #include <boost/config.hpp>
  7. #include <string>
  8. #include <cstring>
  9. #include <windows.h>
  10. #include "dbgeng.h"
  11. #ifdef BOOST_NO_CXX11_THREAD_LOCAL
  12. # error Your compiler does not support C++11 thread_local storage. It`s impossible to build with BOOST_STACKTRACE_USE_WINDBG_CACHED.
  13. #endif
  14. int foo() {
  15. static thread_local std::string i = std::string();
  16. return static_cast<int>(i.size());
  17. }
  18. int main() {
  19. ::CoInitializeEx(0, COINIT_MULTITHREADED);
  20. return foo();
  21. }