Nico Rieck: Currently _MSC_VER and _WIN32 are used to guard code which is
MSVC-specific, MSVCRT-specific, or Windows-specific. Because Clang can
also define _MSC_VER, and MSVCRT is not necessarily the only C runtime,
these macros should not be used interchangeably.
This patch divides all Windows-related bits into the aforementioned
categories. Two new macros are introduced:
- _LIBCPP_MSVC: Defined when compiling with MSVC. Detected using
_MSC_VER, excluding Clang.
- _LIBCPP_MSVCRT: Defined when using the Microsoft CRT. This is the default
when _WIN32 is defined.
This leaves _WIN32 for code using the Windows API.
This also corrects the spelling of _LIBCP_HAS_IS_BASE_OF to _LIBCPP_HAS_IS_BASE_OF.
Nico, please prepare a patch for CREDITS.TXT, thanks.
llvm-svn: 187593
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 0be8f64c44d2fe87fdf8feda175dc39d38a83906
diff --git a/include/vector b/include/vector
index 046d92d..373e7c1 100644
--- a/include/vector
+++ b/include/vector
@@ -309,14 +309,14 @@
#endif
}
-#ifdef _MSC_VER
+#ifdef _LIBCPP_MSVC
#pragma warning( push )
#pragma warning( disable: 4231 )
-#endif // _MSC_VER
+#endif // _LIBCPP_MSVC
_LIBCPP_EXTERN_TEMPLATE(class __vector_base_common<true>)
-#ifdef _MSC_VER
+#ifdef _LIBCPP_MSVC
#pragma warning( pop )
-#endif // _MSC_VER
+#endif // _LIBCPP_MSVC
template <class _Tp, class _Allocator>
class __vector_base