[libcxx] r295330 - math: correct the MSVCRT condition

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 16 07:47:50 PST 2017


Author: compnerd
Date: Thu Feb 16 09:47:50 2017
New Revision: 295330

URL: http://llvm.org/viewvc/llvm-project?rev=295330&view=rev
Log:
math: correct the MSVCRT condition

Fixes a number of tests in the testsuite on Windows.

Modified:
    libcxx/trunk/include/cmath
    libcxx/trunk/include/math.h

Modified: libcxx/trunk/include/cmath
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cmath?rev=295330&r1=295329&r2=295330&view=diff
==============================================================================
--- libcxx/trunk/include/cmath (original)
+++ libcxx/trunk/include/cmath Thu Feb 16 09:47:50 2017
@@ -398,7 +398,7 @@ using ::cbrtf;
 using ::copysign;
 using ::copysignf;
 
-#if !defined(_LIBCPP_MSVCRT) || ((_VC_CRT_NAJOR_VERSION-0) >= 14)
+#if !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
 using ::erf;
 using ::erff;
 using ::erfc;
@@ -435,7 +435,7 @@ using ::lrint;
 using ::lrintf;
 using ::lround;
 using ::lroundf;
-#endif // _LIBCPP_MSVCRT
+#endif // !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
 
 using ::nan;
 using ::nanf;

Modified: libcxx/trunk/include/math.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/math.h?rev=295330&r1=295329&r2=295330&view=diff
==============================================================================
--- libcxx/trunk/include/math.h (original)
+++ libcxx/trunk/include/math.h Thu Feb 16 09:47:50 2017
@@ -1020,7 +1020,7 @@ copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NO
     return ::copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
 }
 
-#if !defined(_LIBCPP_MSVCRT) || ((_VC_CRT_MAJOR_VERSION-0) >= 14)
+#if !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
 
 // erf
 
@@ -1404,7 +1404,7 @@ inline _LIBCPP_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 trunc(_A1 __lcpp_x) _NOEXCEPT {return ::trunc((double)__lcpp_x);}
 
-#endif // !defined(_LIBCPP_MSVCRT) || ((_VC_CRT_MAJOR_VERSION-0) >= 14)
+#endif // !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
 
 } // extern "C++"
 




More information about the cfe-commits mailing list