Wrap include of <future> in some warning suppression pragmas
authorReid Kleckner <rnk@google.com>
Tue, 15 Dec 2015 22:10:30 +0000 (22:10 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 15 Dec 2015 22:10:30 +0000 (22:10 +0000)
Eventually we may need to sink this include to the .cpp file or
something to suport LLVM_ENABLE_THREADS=OFF, but this solves my
immediate problem of fixing the build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255682 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/ThreadPool.h

index 5648db0642afb1abe8cf5fca7dd21ff65518bc10..745334db4450cd3c13b57ec7d4d6de18b8e8ae3c 100644 (file)
 // concrt.h depends on eh.h for __uncaught_exception declaration
 // even if we disable exceptions.
 #include <eh.h>
+
+// Disable warnings from ppltasks.h transitively included by <future>.
+#pragma warning(push)
+#pragma warning(disable:4530)
+#pragma warning(disable:4062)
+#endif
+
+#include <future>
+
+#ifdef _MSC_VER
+#pragma warning(pop)
 #endif
 
 #include <condition_variable>
 #include <functional>
-#include <future>
 #include <memory>
 #include <mutex>
 #include <queue>