[PATCH] D34588: Check for _MSC_VER before define _LIBCPP_MSVCRT

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 17 15:03:07 PDT 2017

bruno added a comment.

> Could something like _WIN32 && _MSC_VER make this better?  That would allow us to differentiate between the various environments.  It's kinda icky, but, does make sense in a round about way.

The check in the patch was already under a `#if defined(_WIN32)`, having to repeat that again seemed not worth the effort!

> Another bad idea: -U_MSC_VER.  The undefine should come after the preprocessor is initialized and should have the same effect as not having it defined.

That's a bit non canonical :-)

In https://reviews.llvm.org/D34588#808076, @rnk wrote:

> > Some non-windows targets using MS extensions define _WIN32 for compatibility with Windows but do not have MSVC compatibility.
> So, these hypothetical targets have the Win32 API available, but they do not use the MSVC CRT, correct?


Thanks for the review! Committed r308225.



More information about the cfe-commits mailing list