[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-commits
Subject:    [libcxx] r230867 - cmath: account for MSVCRT 12.0 changes
From:       Saleem Abdulrasool <compnerd () compnerd ! org>
Date:       2015-02-28 20:18:39
Message-ID: 20150228201839.C339E2A6C04D () llvm ! org
[Download RAW message or body]

Author: compnerd
Date: Sat Feb 28 14:18:39 2015
New Revision: 230867

URL: http://llvm.org/viewvc/llvm-project?rev=230867&view=rev
Log:
cmath: account for MSVCRT 12.0 changes

MSVCRT 12.0 introduces better compatibility for C99. This includes a number of
math routines that were previously undefined. Use the crtversion.h header to
detect the version of MSVCRT being targeted and avoid re-declaring the
variables.

Since copysign has been introduced in MSVCRT, importing the definition via using
makes it difficult to provide overloads (due to minor differences between
throw () and noexcept. Avoid defining the overloads on newer MSVCRT
targets.

Modified:
    libcxx/trunk/include/cmath
    libcxx/trunk/include/support/win32/math_win32.h

Modified: libcxx/trunk/include/cmath
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cmath?rev=230867&r1=230866&r2=230867&view=diff
 ==============================================================================
--- libcxx/trunk/include/cmath (original)
+++ libcxx/trunk/include/cmath Sat Feb 28 14:18:39 2015
@@ -1109,8 +1109,16 @@ cbrt(_A1 __lcpp_x) _NOEXCEPT {return cbr
 using ::copysign;
 using ::copysignf;
 
-inline _LIBCPP_INLINE_VISIBILITY float       copysign(float __lcpp_x, float \
                __lcpp_y) _NOEXCEPT             {return copysignf(__lcpp_x, \
                __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __lcpp_x, long \
double __lcpp_y) _NOEXCEPT {return copysignl(__lcpp_x, __lcpp_y);} +#if \
!defined(_VC_CRT_MAJOR_VERSION) || (_VC_CRT_MAJOR_VERSION < 12) +inline \
_LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x, +                            \
float __lcpp_y) _NOEXCEPT { +  return copysignf(__lcpp_x, __lcpp_y);
+}
+inline _LIBCPP_INLINE_VISIBILITY long double
+copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
+  return copysignl(__lcpp_x, __lcpp_y);
+}
+#endif
 
 template <class _A1, class _A2>
 inline _LIBCPP_INLINE_VISIBILITY

Modified: libcxx/trunk/include/support/win32/math_win32.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/support/win32/math_win32.h?rev=230867&r1=230866&r2=230867&view=diff
 ==============================================================================
--- libcxx/trunk/include/support/win32/math_win32.h (original)
+++ libcxx/trunk/include/support/win32/math_win32.h Sat Feb 28 14:18:39 2015
@@ -17,7 +17,9 @@
 
 #include <math.h>
 #include <float.h> // _FPCLASS_PN etc.
+#include <crtversion.h>
 
+#if ((_VC_CRT_MAJOR_VERSION-0) < 12)
 // Necessary?
 typedef float float_t;
 typedef double double_t;
@@ -109,7 +111,7 @@ _LIBCPP_ALWAYS_INLINE int fpclassify( do
 {
     return _fpclass(num);
 }
-
+#endif
 #endif // _LIBCPP_MSVCRT
 
 #endif // _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H


_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic