<div dir="ltr">Should this be a compile-time thing? I thought in general we try to make clang-built-with-msvc and clang-built-with-mingw behave roughly the same except for a different default triple, i.e. maybe this should be keyed off the triple at runtime instead of with a compile-time ifdef. Or do some of the APIs the 2017 path calls not exist in mingw?</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 15, 2017 at 1:09 PM, Zachary Turner via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: zturner<br>
Date: Wed Mar 15 12:09:36 2017<br>
New Revision: 297861<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=297861&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=297861&view=rev</a><br>
Log:<br>
Don't use MSVC Setup Api on MinGW.<br>
<br>
Modified:<br>
    cfe/trunk/lib/Driver/<wbr>ToolChains/MSVC.cpp<br>
<br>
Modified: cfe/trunk/lib/Driver/<wbr>ToolChains/MSVC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MSVC.cpp?rev=297861&r1=297860&r2=297861&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Driver/<wbr>ToolChains/MSVC.cpp?rev=<wbr>297861&r1=297860&r2=297861&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/<wbr>ToolChains/MSVC.cpp (original)<br>
+++ cfe/trunk/lib/Driver/<wbr>ToolChains/MSVC.cpp Wed Mar 15 12:09:36 2017<br>
@@ -44,6 +44,11 @@<br>
     #define NOMINMAX<br>
   #endif<br>
   #include <windows.h><br>
+#endif<br>
+<br>
+#ifdef _MSC_VER<br>
+// Don't support SetupApi on MinGW.<br>
+#define USE_MSVC_SETUP_API<br>
<br>
 // Make sure this comes before MSVCSetupApi.h<br>
 #include <comdef.h><br>
@@ -170,7 +175,7 @@ static bool findVCToolChainViaEnvironmen<br>
 // longer listed in the registry.<br>
 static bool findVCToolChainViaSetupConfig(<wbr>std::string &Path,<br>
                                           bool &IsVS2017OrNewer) {<br>
-#if !defined(USE_WIN32)<br>
+#if !defined(USE_MSVC_SETUP_API)<br>
   return false;<br>
 #else<br>
   // FIXME: This really should be done once in the top-level program's main<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>