From bcc85cbcde661e8bf02a5e0c385f9aa509a8dc39 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 6 Feb 2017 05:26:49 +0000 Subject: [PATCH] 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! llvm-svn: 294171 --- libcxx/include/__config | 2 +- libcxx/include/__undef_min_max | 4 ++-- libcxx/include/ext/hash_map | 2 +- libcxx/include/ext/hash_set | 2 +- libcxx/src/exception.cpp | 12 ++++++------ libcxx/src/include/atomic_support.h | 2 +- libcxx/src/thread.cpp | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libcxx/include/__config b/libcxx/include/__config index a70f8f0060fd3..10de952e7c333 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -929,7 +929,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( # if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \ (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI) # define _LIBCPP_NO_RTTI -# elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI) +# elif defined(_LIBCPP_MSVC) && !defined(_CPPRTTI) # define _LIBCPP_NO_RTTI # endif #endif diff --git a/libcxx/include/__undef_min_max b/libcxx/include/__undef_min_max index d3c31388cead8..f4ca091def455 100644 --- a/libcxx/include/__undef_min_max +++ b/libcxx/include/__undef_min_max @@ -10,7 +10,7 @@ #ifdef min #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 " "before any Windows header. #undefing min") #else @@ -22,7 +22,7 @@ _LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX " #ifdef max #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 " "before any Windows header. #undefing max") #else diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map index 8998bec66c312..fab36a155bac1 100644 --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -207,7 +207,7 @@ template #include #if __DEPRECATED -#if defined(_MSC_VER) && ! defined(__clang__) +#if defined(_LIBCPP_MSVC) _LIBCPP_WARNING("Use of the header is deprecated. Migrate to ") #else # warning Use of the header is deprecated. Migrate to diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set index 7c6a8bf0ccc74..916ed6910d7d9 100644 --- a/libcxx/include/ext/hash_set +++ b/libcxx/include/ext/hash_set @@ -199,7 +199,7 @@ template #include #if __DEPRECATED -#if defined(_MSC_VER) && ! defined(__clang__) +#if defined(_LIBCPP_MSVC) _LIBCPP_WARNING("Use of the header is deprecated. Migrate to ") #else # warning Use of the header is deprecated. Migrate to diff --git a/libcxx/src/exception.cpp b/libcxx/src/exception.cpp index f25041d834276..35a3a9abaeb13 100644 --- a/libcxx/src/exception.cpp +++ b/libcxx/src/exception.cpp @@ -138,7 +138,7 @@ int uncaught_exceptions() _NOEXCEPT #elif defined(_LIBCPP_ABI_MICROSOFT) return __uncaught_exceptions(); #else -# if defined(_MSC_VER) && ! defined(__clang__) +# if defined(_LIBCPP_MSVC) _LIBCPP_WARNING("uncaught_exceptions not yet implemented") # else # warning uncaught_exception not yet implemented @@ -211,7 +211,7 @@ exception_ptr::~exception_ptr() _NOEXCEPT #elif defined(__GLIBCXX__) reinterpret_cast<__exception_ptr::exception_ptr*>(this)->~exception_ptr(); #else -# if defined(_MSC_VER) && ! defined(__clang__) +# if defined(_LIBCPP_MSVC) _LIBCPP_WARNING("exception_ptr not yet implemented") # else # warning exception_ptr not yet implemented @@ -230,7 +230,7 @@ exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT new (reinterpret_cast(this)) __exception_ptr::exception_ptr( reinterpret_cast(other)); #else -# if defined(_MSC_VER) && ! defined(__clang__) +# if defined(_LIBCPP_MSVC) _LIBCPP_WARNING("exception_ptr not yet implemented") # else # warning exception_ptr not yet implemented @@ -255,7 +255,7 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT reinterpret_cast(other); return *this; #else -# if defined(_MSC_VER) && ! defined(__clang__) +# if defined(_LIBCPP_MSVC) _LIBCPP_WARNING("exception_ptr not yet implemented") # else # warning exception_ptr not yet implemented @@ -299,7 +299,7 @@ exception_ptr current_exception() _NOEXCEPT ptr.__ptr_ = __cxa_current_primary_exception(); return ptr; #else -# if defined(_MSC_VER) && ! defined(__clang__) +# if defined(_LIBCPP_MSVC) _LIBCPP_WARNING( "exception_ptr not yet implemented" ) # else # warning exception_ptr not yet implemented @@ -321,7 +321,7 @@ void rethrow_exception(exception_ptr p) #elif defined(__GLIBCXX__) rethrow_exception(reinterpret_cast<__exception_ptr::exception_ptr&>(p)); #else -# if defined(_MSC_VER) && ! defined(__clang__) +# if defined(_LIBCPP_MSVC) _LIBCPP_WARNING("exception_ptr not yet implemented") # else # warning exception_ptr not yet implemented diff --git a/libcxx/src/include/atomic_support.h b/libcxx/src/include/atomic_support.h index af0f5f505ea54..378541b232562 100644 --- a/libcxx/src/include/atomic_support.h +++ b/libcxx/src/include/atomic_support.h @@ -29,7 +29,7 @@ #endif #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") # else # warning Building libc++ without __atomic builtins is unsupported diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp index c471b5c022ece..afa8e163bec93 100644 --- a/libcxx/src/thread.cpp +++ b/libcxx/src/thread.cpp @@ -99,7 +99,7 @@ thread::hardware_concurrency() _NOEXCEPT #else // defined(CTL_HW) && defined(HW_NCPU) // TODO: grovel through /proc or check cpuid on x86 and similar // instructions on other architectures. -# if defined(_MSC_VER) && ! defined(__clang__) +# if defined(_LIBCPP_MSVC) _LIBCPP_WARNING("hardware_concurrency not yet implemented") # else # warning hardware_concurrency not yet implemented