[PATCH] D34588: Check for _MSC_VER before define _LIBCPP_MSVCRT

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 23 18:42:24 PDT 2017


smeenai added reviewers: compnerd, majnemer, rnk.
smeenai added subscribers: majnemer, compnerd.
smeenai added a comment.

This looks sensible to me. I don't know if there are any scenarios in which you'd be using the Microsoft CRT without having `_MSC_VER` defined, however. Added some people who may have a better idea of that (@compnerd, @majnemer and @rnk)



================
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
----------------
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.)


https://reviews.llvm.org/D34588





More information about the cfe-commits mailing list