[PATCH] D59676: Make Parallel.h build with libc++ on Windows.

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 16:56:20 PDT 2019


thakis created this revision.
thakis added a reviewer: rnk.
Herald added a reviewer: EricWF.
Herald added a project: LLVM.

ppl.h requires yvals.h to be included, but it only includes a few
standard library headers and depends on those including yvals.h.

It seems unfortunate to make libc++/win include yvals.h in all header
files, so just add an explicit include of yvals.h here instead.


https://reviews.llvm.org/D59676

Files:
  llvm/include/llvm/Support/Parallel.h


Index: llvm/include/llvm/Support/Parallel.h
===================================================================
--- llvm/include/llvm/Support/Parallel.h
+++ llvm/include/llvm/Support/Parallel.h
@@ -21,6 +21,13 @@
 #if defined(_MSC_VER) && LLVM_ENABLE_THREADS
 #pragma warning(push)
 #pragma warning(disable : 4530)
+
+// With Microsoft's Standard Library, all C++ standard library headers include
+// yvals.h.  With libc++, that isn't the case but ppl.h depends on having
+// yvals.h be included first, and it only includes a few standard library
+// headers. To make things work, explicitly include it here.
+#include <yvals.h>
+
 #include <concrt.h>
 #include <ppl.h>
 #pragma warning(pop)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59676.191801.patch
Type: text/x-patch
Size: 692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190321/ea69407d/attachment.bin>


More information about the llvm-commits mailing list