From 0be8f64c44d2fe87fdf8feda175dc39d38a83906 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 1 Aug 2013 18:17:34 +0000 Subject: 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 --- libcxx/include/algorithm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libcxx/include/algorithm') diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index 1403fd68fe7..2fc1f8ab4bb 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -3988,10 +3988,10 @@ sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last, _Compare __comp) _VSTD::sort<_Tp*, _Comp_ref>(__first.base(), __last.base(), __comp); } -#ifdef _MSC_VER +#ifdef _LIBCPP_MSVC #pragma warning( push ) #pragma warning( disable: 4231) -#endif // _MSC_VER +#endif // _LIBCPP_MSVC _LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, char*>(char*, char*, __less&)) _LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&)) _LIBCPP_EXTERN_TEMPLATE(void __sort<__less&, signed char*>(signed char*, signed char*, __less&)) @@ -4025,9 +4025,9 @@ _LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, double _LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less&, long double*>(long double*, long double*, __less&)) _LIBCPP_EXTERN_TEMPLATE(unsigned __sort5<__less&, long double*>(long double*, long double*, long double*, long double*, long double*, __less&)) -#ifdef _MSC_VER +#ifdef _LIBCPP_MSVC #pragma warning( pop ) -#endif // _MSC_VER +#endif // _LIBCPP_MSVC // lower_bound -- cgit v1.2.3