[PATCH] D34588: Check for _MSC_VER before define _LIBCPP_MSVCRT

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 24 16:10:48 PDT 2017

compnerd added inline comments.

Comment at: include/__config:234-235
+// a MS compatibility version is specified.
 #  ifndef __MINGW32__
-#    define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
+#    ifdef _MSC_VER
+#      define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
smeenai wrote:
> You can combine this into just
> ```
> #  if defined(_MSC_VER) && !defined(__MINGW32__)
> ```
> I don't know if `__MINGW32__` and `_MSC_VER` will ever be compiled simultaneously. (clang never defines `_MSC_VER` for its MinGW triples, for example.)
What if MinGW is built with clang/c2 and MSVC extensions?  I think that the two could be defined together.  What about cygwin and clang/c2?  I guess we can ignore that since cygwin is not under active development.

I think this really goes back to my idea for an additional flag to indicate the C library in use.  We can interpret it from the canonicalized triple that LLVM/clang use.


More information about the cfe-commits mailing list