Refer to _LIBCPP_MSVC macro where applicable

Replace preprocess conditions of defined(_MSC_VER) &&
!defined(__clang__) with defined(_LIBCPP_MSVC).  NFC.

Patch by Dave Lee!

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294171 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool
2017-02-06 05:26:49 +00:00
parent a67aa062c6
commit cda122b353
7 changed files with 13 additions and 13 deletions

View File

@@ -929,7 +929,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
# if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \ # if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \
(__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI) (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI)
# define _LIBCPP_NO_RTTI # define _LIBCPP_NO_RTTI
# elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI) # elif defined(_LIBCPP_MSVC) && !defined(_CPPRTTI)
# define _LIBCPP_NO_RTTI # define _LIBCPP_NO_RTTI
# endif # endif
#endif #endif

View File

@@ -10,7 +10,7 @@
#ifdef min #ifdef min
#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) #if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
#if defined(_MSC_VER) && ! defined(__clang__) #if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX " _LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX "
"before any Windows header. #undefing min") "before any Windows header. #undefing min")
#else #else
@@ -22,7 +22,7 @@ _LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX "
#ifdef max #ifdef max
#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) #if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
#if defined(_MSC_VER) && ! defined(__clang__) #if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("macro max is incompatible with C++. Try #define NOMINMAX " _LIBCPP_WARNING("macro max is incompatible with C++. Try #define NOMINMAX "
"before any Windows header. #undefing max") "before any Windows header. #undefing max")
#else #else

View File

@@ -207,7 +207,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <ext/__hash> #include <ext/__hash>
#if __DEPRECATED #if __DEPRECATED
#if defined(_MSC_VER) && ! defined(__clang__) #if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>") _LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>")
#else #else
# warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map> # warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>

View File

@@ -199,7 +199,7 @@ template <class Value, class Hash, class Pred, class Alloc>
#include <ext/__hash> #include <ext/__hash>
#if __DEPRECATED #if __DEPRECATED
#if defined(_MSC_VER) && ! defined(__clang__) #if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>") _LIBCPP_WARNING("Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>")
#else #else
# warning Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set> # warning Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>

View File

@@ -138,7 +138,7 @@ int uncaught_exceptions() _NOEXCEPT
#elif defined(_LIBCPP_ABI_MICROSOFT) #elif defined(_LIBCPP_ABI_MICROSOFT)
return __uncaught_exceptions(); return __uncaught_exceptions();
#else #else
# if defined(_MSC_VER) && ! defined(__clang__) # if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("uncaught_exceptions not yet implemented") _LIBCPP_WARNING("uncaught_exceptions not yet implemented")
# else # else
# warning uncaught_exception not yet implemented # warning uncaught_exception not yet implemented
@@ -211,7 +211,7 @@ exception_ptr::~exception_ptr() _NOEXCEPT
#elif defined(__GLIBCXX__) #elif defined(__GLIBCXX__)
reinterpret_cast<__exception_ptr::exception_ptr*>(this)->~exception_ptr(); reinterpret_cast<__exception_ptr::exception_ptr*>(this)->~exception_ptr();
#else #else
# if defined(_MSC_VER) && ! defined(__clang__) # if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("exception_ptr not yet implemented") _LIBCPP_WARNING("exception_ptr not yet implemented")
# else # else
# warning exception_ptr not yet implemented # warning exception_ptr not yet implemented
@@ -230,7 +230,7 @@ exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
new (reinterpret_cast<void*>(this)) __exception_ptr::exception_ptr( new (reinterpret_cast<void*>(this)) __exception_ptr::exception_ptr(
reinterpret_cast<const __exception_ptr::exception_ptr&>(other)); reinterpret_cast<const __exception_ptr::exception_ptr&>(other));
#else #else
# if defined(_MSC_VER) && ! defined(__clang__) # if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("exception_ptr not yet implemented") _LIBCPP_WARNING("exception_ptr not yet implemented")
# else # else
# warning exception_ptr not yet implemented # warning exception_ptr not yet implemented
@@ -255,7 +255,7 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
reinterpret_cast<const __exception_ptr::exception_ptr&>(other); reinterpret_cast<const __exception_ptr::exception_ptr&>(other);
return *this; return *this;
#else #else
# if defined(_MSC_VER) && ! defined(__clang__) # if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("exception_ptr not yet implemented") _LIBCPP_WARNING("exception_ptr not yet implemented")
# else # else
# warning exception_ptr not yet implemented # warning exception_ptr not yet implemented
@@ -299,7 +299,7 @@ exception_ptr current_exception() _NOEXCEPT
ptr.__ptr_ = __cxa_current_primary_exception(); ptr.__ptr_ = __cxa_current_primary_exception();
return ptr; return ptr;
#else #else
# if defined(_MSC_VER) && ! defined(__clang__) # if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING( "exception_ptr not yet implemented" ) _LIBCPP_WARNING( "exception_ptr not yet implemented" )
# else # else
# warning exception_ptr not yet implemented # warning exception_ptr not yet implemented
@@ -321,7 +321,7 @@ void rethrow_exception(exception_ptr p)
#elif defined(__GLIBCXX__) #elif defined(__GLIBCXX__)
rethrow_exception(reinterpret_cast<__exception_ptr::exception_ptr&>(p)); rethrow_exception(reinterpret_cast<__exception_ptr::exception_ptr&>(p));
#else #else
# if defined(_MSC_VER) && ! defined(__clang__) # if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("exception_ptr not yet implemented") _LIBCPP_WARNING("exception_ptr not yet implemented")
# else # else
# warning exception_ptr not yet implemented # warning exception_ptr not yet implemented

View File

@@ -29,7 +29,7 @@
#endif #endif
#if !defined(_LIBCPP_HAS_ATOMIC_BUILTINS) && !defined(_LIBCPP_HAS_NO_THREADS) #if !defined(_LIBCPP_HAS_ATOMIC_BUILTINS) && !defined(_LIBCPP_HAS_NO_THREADS)
# if defined(_MSC_VER) && !defined(__clang__) # if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("Building libc++ without __atomic builtins is unsupported") _LIBCPP_WARNING("Building libc++ without __atomic builtins is unsupported")
# else # else
# warning Building libc++ without __atomic builtins is unsupported # warning Building libc++ without __atomic builtins is unsupported

View File

@@ -99,7 +99,7 @@ thread::hardware_concurrency() _NOEXCEPT
#else // defined(CTL_HW) && defined(HW_NCPU) #else // defined(CTL_HW) && defined(HW_NCPU)
// TODO: grovel through /proc or check cpuid on x86 and similar // TODO: grovel through /proc or check cpuid on x86 and similar
// instructions on other architectures. // instructions on other architectures.
# if defined(_MSC_VER) && ! defined(__clang__) # if defined(_LIBCPP_MSVC)
_LIBCPP_WARNING("hardware_concurrency not yet implemented") _LIBCPP_WARNING("hardware_concurrency not yet implemented")
# else # else
# warning hardware_concurrency not yet implemented # warning hardware_concurrency not yet implemented