summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/gtest_common.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-03-18 16:56:24 +0000
committerZachary Turner <zturner@google.com>2015-03-18 16:56:24 +0000
commit799770c03ac128016560ff93b98066330e07568e (patch)
tree95fdf41f97b6de381a91aa591d8d279c61244e22 /lldb/unittests/gtest_common.h
parente4cdb8fcb309f9459b7d8d67b66d90597e762f9c (diff)
downloadbcm5719-llvm-799770c03ac128016560ff93b98066330e07568e.tar.gz
bcm5719-llvm-799770c03ac128016560ff93b98066330e07568e.zip
Fix linking of unit tests via CMake on Windows.
A previous attempt to make the unit tests link properly on Linux broke it for Windows. This patch fixes it for both platforms. llvm-svn: 232648
Diffstat (limited to 'lldb/unittests/gtest_common.h')
-rw-r--r--lldb/unittests/gtest_common.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/lldb/unittests/gtest_common.h b/lldb/unittests/gtest_common.h
index 1fb394a745e..006c9596ca4 100644
--- a/lldb/unittests/gtest_common.h
+++ b/lldb/unittests/gtest_common.h
@@ -17,16 +17,8 @@
// units. Be very leary about putting anything in this file.
#if defined(_MSC_VER) && (_HAS_EXCEPTIONS == 0)
-// MSVC's STL implementation tries to work well with /EHs-c- and
-// _HAS_EXCEPTIONS=0. But <thread> in particular doesn't work with it, because
-// it relies on <concrt.h> which tries to throw an exception without checking
-// for _HAS_EXCEPTIONS=0. This causes the linker to require a definition of
-// __uncaught_exception(), but the STL doesn't define this function when
-// _HAS_EXCEPTIONS=0. The workaround here is to just provide a stub
-// implementation to get it to link.
-inline bool
-__uncaught_exception()
-{
- return true;
-}
+// Due to a bug in <thread>, when _HAS_EXCEPTIONS == 0 the header will try to call
+// uncaught_exception() without having a declaration for it. The fix for this is
+// to manually #include <eh.h>, which contains this declaration.
+#include <eh.h>
#endif
OpenPOWER on IntegriCloud