[libcxx] r294171 - Refer to _LIBCPP_MSVC macro where applicable

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 5 21:26:50 PST 2017


Author: compnerd
Date: Sun Feb  5 23:26:49 2017
New Revision: 294171

URL: http://llvm.org/viewvc/llvm-project?rev=294171&view=rev
Log:
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!

Modified:
    libcxx/trunk/include/__config
    libcxx/trunk/include/__undef_min_max
    libcxx/trunk/include/ext/hash_map
    libcxx/trunk/include/ext/hash_set
    libcxx/trunk/src/exception.cpp
    libcxx/trunk/src/include/atomic_support.h
    libcxx/trunk/src/thread.cpp

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=294171&r1=294170&r2=294171&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Sun Feb  5 23:26:49 2017
@@ -929,7 +929,7 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
 #  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

Modified: libcxx/trunk/include/__undef_min_max
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__undef_min_max?rev=294171&r1=294170&r2=294171&view=diff
==============================================================================
--- libcxx/trunk/include/__undef_min_max (original)
+++ libcxx/trunk/include/__undef_min_max Sun Feb  5 23:26:49 2017
@@ -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 incompatib
 
 #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

Modified: libcxx/trunk/include/ext/hash_map
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ext/hash_map?rev=294171&r1=294170&r2=294171&view=diff
==============================================================================
--- libcxx/trunk/include/ext/hash_map (original)
+++ libcxx/trunk/include/ext/hash_map Sun Feb  5 23:26:49 2017
@@ -207,7 +207,7 @@ template <class Key, class T, class Hash
 #include <ext/__hash>
 
 #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>")
 #else
 #   warning Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>

Modified: libcxx/trunk/include/ext/hash_set
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ext/hash_set?rev=294171&r1=294170&r2=294171&view=diff
==============================================================================
--- libcxx/trunk/include/ext/hash_set (original)
+++ libcxx/trunk/include/ext/hash_set Sun Feb  5 23:26:49 2017
@@ -199,7 +199,7 @@ template <class Value, class Hash, class
 #include <ext/__hash>
 
 #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>")
 #else
 #   warning Use of the header <ext/hash_set> is deprecated.  Migrate to <unordered_set>

Modified: libcxx/trunk/src/exception.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/exception.cpp?rev=294171&r1=294170&r2=294171&view=diff
==============================================================================
--- libcxx/trunk/src/exception.cpp (original)
+++ libcxx/trunk/src/exception.cpp Sun Feb  5 23:26:49 2017
@@ -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() _NOEXCEP
 #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 excep
     new (reinterpret_cast<void*>(this)) __exception_ptr::exception_ptr(
         reinterpret_cast<const __exception_ptr::exception_ptr&>(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=(
         reinterpret_cast<const __exception_ptr::exception_ptr&>(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() _NOEXC
     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

Modified: libcxx/trunk/src/include/atomic_support.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/include/atomic_support.h?rev=294171&r1=294170&r2=294171&view=diff
==============================================================================
--- libcxx/trunk/src/include/atomic_support.h (original)
+++ libcxx/trunk/src/include/atomic_support.h Sun Feb  5 23:26:49 2017
@@ -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

Modified: libcxx/trunk/src/thread.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/thread.cpp?rev=294171&r1=294170&r2=294171&view=diff
==============================================================================
--- libcxx/trunk/src/thread.cpp (original)
+++ libcxx/trunk/src/thread.cpp Sun Feb  5 23:26:49 2017
@@ -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




More information about the cfe-commits mailing list