[llvm] r246218 - Support: Introduce thread.h.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 14:52:32 PDT 2015


Author: pcc
Date: Thu Aug 27 16:52:31 2015
New Revision: 246218

URL: http://llvm.org/viewvc/llvm-project?rev=246218&view=rev
Log:
Support: Introduce thread.h.

This header is a wrapper for <thread> that works around problems with the
MSVC headers when exceptions are disabled.

Added:
    llvm/trunk/include/llvm/Support/thread.h

Added: llvm/trunk/include/llvm/Support/thread.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/thread.h?rev=246218&view=auto
==============================================================================
--- llvm/trunk/include/llvm/Support/thread.h (added)
+++ llvm/trunk/include/llvm/Support/thread.h Thu Aug 27 16:52:31 2015
@@ -0,0 +1,34 @@
+//===-- llvm/Support/thread.h - Wrapper for <thread> ------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This header is a wrapper for <thread> that works around problems with the
+// MSVC headers when exceptions are disabled.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_THREAD_H
+#define LLVM_SUPPORT_THREAD_H
+
+#ifdef _MSC_VER
+// concrt.h depends on eh.h for __uncaught_exception declaration
+// even if we disable exceptions.
+#include <eh.h>
+
+// Suppress 'C++ exception handler used, but unwind semantics are not enabled.'
+#pragma warning(push)
+#pragma warning(disable:4530)
+#endif
+
+#include <thread>
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+#endif




More information about the llvm-commits mailing list