summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2017-07-17 21:52:31 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2017-07-17 21:52:31 +0000
commitda4047d8384ec30c33f2dad1091325b81d39cf72 (patch)
tree6a35302612b2b4474de84053d3149a0a064bef7f
parent7afe61ad1dd29bd3db4668655502a1109b7cfea0 (diff)
downloadexternal_libcxx-da4047d8384ec30c33f2dad1091325b81d39cf72.tar.gz
external_libcxx-da4047d8384ec30c33f2dad1091325b81d39cf72.tar.bz2
external_libcxx-da4047d8384ec30c33f2dad1091325b81d39cf72.zip
Check for _MSC_VER before defining _LIBCPP_MSVCRT
Some targets (e.g. Darwin) might have the Win32 API available, but they do not use MSVC CRT. Assume _LIBCPP_MSVCRT only when _MSC_VER is available and __MINGW32__ isn't defined. Differential Revision: https://reviews.llvm.org/D34588 rdar://problem/32628786 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@308225 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/__config5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/__config b/include/__config
index 38fa8c8f9..f15d2d06e 100644
--- a/include/__config
+++ b/include/__config
@@ -229,8 +229,9 @@
# define _LIBCPP_SHORT_WCHAR 1
// Both MinGW and native MSVC provide a "MSVC"-like enviroment
# define _LIBCPP_MSVCRT_LIKE
-// If mingw not explicitly detected, assume using MS C runtime only.
-# ifndef __MINGW32__
+// If mingw not explicitly detected, assume using MS C runtime only if
+// a MS compatibility version is specified.
+# if defined(_MSC_VER) && !defined(__MINGW32__)
# define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
# endif
# if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__))