[llvm] r255682 - Wrap include of <future> in some warning suppression pragmas

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 14:10:30 PST 2015


Author: rnk
Date: Tue Dec 15 16:10:30 2015
New Revision: 255682

URL: http://llvm.org/viewvc/llvm-project?rev=255682&view=rev
Log:
Wrap include of <future> in some warning suppression pragmas

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.

Modified:
    llvm/trunk/include/llvm/Support/ThreadPool.h

Modified: llvm/trunk/include/llvm/Support/ThreadPool.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ThreadPool.h?rev=255682&r1=255681&r2=255682&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/ThreadPool.h (original)
+++ llvm/trunk/include/llvm/Support/ThreadPool.h Tue Dec 15 16:10:30 2015
@@ -20,11 +20,21 @@
 // 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>




More information about the llvm-commits mailing list