summaryrefslogtreecommitdiffstats
path: root/libcxx/include/support/win32/math_win32.h
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-02-28 20:18:39 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-02-28 20:18:39 +0000
commit66d4c6e78cef2aad52b7a0344a5afc073c638ca9 (patch)
tree2f8cce3c3e82415f13020f5b4cad2285a0206cad /libcxx/include/support/win32/math_win32.h
parent4b7dd64d829b5745590c0cb1bafe92ea66eec661 (diff)
downloadbcm5719-llvm-66d4c6e78cef2aad52b7a0344a5afc073c638ca9.tar.gz
bcm5719-llvm-66d4c6e78cef2aad52b7a0344a5afc073c638ca9.zip
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. llvm-svn: 230867
Diffstat (limited to 'libcxx/include/support/win32/math_win32.h')
-rw-r--r--libcxx/include/support/win32/math_win32.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/include/support/win32/math_win32.h b/libcxx/include/support/win32/math_win32.h
index c62c54e3cd8..0d6b422a165 100644
--- a/libcxx/include/support/win32/math_win32.h
+++ b/libcxx/include/support/win32/math_win32.h
@@ -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( double num )
{
return _fpclass(num);
}
-
+#endif
#endif // _LIBCPP_MSVCRT
#endif // _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H
OpenPOWER on IntegriCloud