diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-04-01 12:55:33 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-04-01 12:55:33 -0700 |
commit | 8408257cd66435af849f493c10c7f0e8d1d5fa3b (patch) | |
tree | 8b05963e8608b22f71620f512679d7cd5b1de548 /system/include/libcxx/ratio | |
parent | a8e4801c7d38033fff760ea26a4579aa324e303e (diff) | |
parent | 36600f34ef0ec2cf75165be3753567e256f514db (diff) |
Merge branch 'incoming'
Diffstat (limited to 'system/include/libcxx/ratio')
-rw-r--r-- | system/include/libcxx/ratio | 26 |
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; |