aboutsummaryrefslogtreecommitdiff
path: root/system/include/libcxx/ratio
diff options
context:
space:
mode:
Diffstat (limited to 'system/include/libcxx/ratio')
-rw-r--r--system/include/libcxx/ratio26
1 files changed, 18 insertions, 8 deletions
diff --git a/system/include/libcxx/ratio b/system/include/libcxx/ratio
index 9764014a..23f22679 100644
--- a/system/include/libcxx/ratio
+++ b/system/include/libcxx/ratio
@@ -70,7 +70,11 @@ typedef ratio<1000000000000000000000000, 1> yotta; // not supported
#include <climits>
#include <type_traits>
+#include <__undef_min_max>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -88,6 +92,12 @@ struct __static_gcd<_Xp, 0>
static const intmax_t value = _Xp;
};
+template <>
+struct __static_gcd<0, 0>
+{
+ static const intmax_t value = 1;
+};
+
// __static_lcm
template <intmax_t _Xp, intmax_t _Yp>
@@ -404,27 +414,27 @@ struct __ratio_less1
static const bool value = _Odd ? _Q2 < _Q1 : _Q1 < _Q2;
};
-template <class _R1, class _R2, bool _Odd, intmax_t _Q>
-struct __ratio_less1<_R1, _R2, _Odd, _Q, 0, _Q, 0>
+template <class _R1, class _R2, bool _Odd, intmax_t _Qp>
+struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, 0>
{
static const bool value = false;
};
-template <class _R1, class _R2, bool _Odd, intmax_t _Q, intmax_t _M2>
-struct __ratio_less1<_R1, _R2, _Odd, _Q, 0, _Q, _M2>
+template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M2>
+struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, _M2>
{
static const bool value = !_Odd;
};
-template <class _R1, class _R2, bool _Odd, intmax_t _Q, intmax_t _M1>
-struct __ratio_less1<_R1, _R2, _Odd, _Q, _M1, _Q, 0>
+template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M1>
+struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, 0>
{
static const bool value = _Odd;
};
-template <class _R1, class _R2, bool _Odd, intmax_t _Q, intmax_t _M1,
+template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M1,
intmax_t _M2>
-struct __ratio_less1<_R1, _R2, _Odd, _Q, _M1, _Q, _M2>
+struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, _M2>
{
static const bool value = __ratio_less1<ratio<_R1::den, _M1>,
ratio<_R2::den, _M2>, !_Odd>::value;