[libcxx] r295509 - cmath: Use c99 math on a new enough msvcrt

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 17 15:08:43 PST 2017


Author: compnerd
Date: Fri Feb 17 17:08:42 2017
New Revision: 295509

URL: http://llvm.org/viewvc/llvm-project?rev=295509&view=rev
Log:
cmath: Use c99 math on a new enough msvcrt

MSVCRT 14+ supports the C99 math routines that we need.  Use them
accordingly.

Modified:
    libcxx/trunk/include/cmath

Modified: libcxx/trunk/include/cmath
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cmath?rev=295509&r1=295508&r2=295509&view=diff
==============================================================================
--- libcxx/trunk/include/cmath (original)
+++ libcxx/trunk/include/cmath Fri Feb 17 17:08:42 2017
@@ -440,7 +440,7 @@ using ::lroundf;
 using ::nan;
 using ::nanf;
 
-#ifndef _LIBCPP_MSVCRT
+#if !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
 using ::nearbyint;
 using ::nearbyintf;
 using ::nextafter;
@@ -463,7 +463,7 @@ using ::tgamma;
 using ::tgammaf;
 using ::trunc;
 using ::truncf;
-#endif // !_LIBCPP_MSVCRT
+#endif // !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
 
 using ::acosl;
 using ::asinl;
@@ -495,7 +495,7 @@ using ::cbrtl;
 
 using ::copysignl;
 
-#if !defined(_LIBCPP_MSVCRT) || (_VC_CRT_MAJOR_VERSION-0) >= 14
+#if !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
 using ::erfl;
 using ::erfcl;
 using ::exp2l;
@@ -526,7 +526,7 @@ using ::scalblnl;
 using ::scalbnl;
 using ::tgammal;
 using ::truncl;
-#endif // !defined(_LIBCPP_MSVCRT) || (_VC_CRT_MAJOR_VERSION-0) >= 14
+#endif // !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
 
 #if _LIBCPP_STD_VER > 14
 inline _LIBCPP_INLINE_VISIBILITY float       hypot(       float x,       float y,       float z ) { return sqrt(x*x + y*y + z*z); }




More information about the cfe-commits mailing list