|
12 | 12 |
|
13 | 13 | #include <boost/config.hpp>
|
14 | 14 |
|
15 |
| -#ifdef BOOST_HAS_FLOAT128 |
16 |
| -# if __has_include(<quadmath.h>) |
17 |
| -# include <quadmath.h> |
18 |
| -# ifndef BOOST_MP_HAS_FLOAT128_SUPPORT |
19 |
| -# define BOOST_MP_HAS_FLOAT128_SUPPORT |
20 |
| -# endif |
21 |
| -# endif |
| 15 | +#if defined(BOOST_HAS_FLOAT128) |
| 16 | +#if defined(__has_include) |
| 17 | +#if __has_include(<quadmath.h>) |
| 18 | + |
| 19 | +#include <quadmath.h> |
| 20 | + |
| 21 | +#if !defined(BOOST_MP_CPP_DOUBLE_FP_HAS_FLOAT128) |
| 22 | +#define BOOST_MP_CPP_DOUBLE_FP_HAS_FLOAT128 |
22 | 23 | #endif
|
23 | 24 |
|
| 25 | +#endif // __has_include(<quadmath.h>) |
| 26 | +#endif // defined(__has_include) |
| 27 | +#endif // defined(BOOST_HAS_FLOAT128) |
| 28 | + |
24 | 29 | #include <boost/multiprecision/number.hpp>
|
25 | 30 | #include <boost/multiprecision/detail/float128_functions.hpp>
|
26 | 31 | #include <boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath.hpp>
|
|
30 | 35 | namespace boost { namespace multiprecision { namespace backends { namespace cpp_df_qf_detail {
|
31 | 36 |
|
32 | 37 | template <class FloatingPointType>
|
33 |
| -struct is_floating_point_or_float128 |
| 38 | +struct is_floating_point |
34 | 39 | {
|
35 |
| - static constexpr auto value = std::is_same<FloatingPointType, float>::value |
36 |
| - || std::is_same<FloatingPointType, double>::value |
37 |
| - || std::is_same<FloatingPointType, long double>::value |
38 |
| -#if defined(BOOST_HAS_FLOAT128) |
39 |
| - || std::is_same<FloatingPointType, ::boost::float128_type>::value |
| 40 | + static constexpr auto value = ::std::is_same<FloatingPointType, float>::value |
| 41 | + || ::std::is_same<FloatingPointType, double>::value |
| 42 | + || ::std::is_same<FloatingPointType, long double>::value |
| 43 | +#if defined(BOOST_MP_CPP_DOUBLE_FP_HAS_FLOAT128) |
| 44 | + || ::std::is_same<FloatingPointType, ::boost::float128_type>::value |
40 | 45 | #endif
|
41 | 46 | ;
|
42 | 47 | };
|
@@ -77,8 +82,7 @@ struct exact_arithmetic
|
77 | 82 | // The exact_arithmetic<> struct implements extended precision
|
78 | 83 | // techniques that are used in cpp_double_fp_backend and cpp_quad_float.
|
79 | 84 |
|
80 |
| - static_assert(is_floating_point_or_float128<FloatingPointType>::value, |
81 |
| - "Error: exact_arithmetic<> invoked with unknown floating-point type"); |
| 85 | + static_assert(is_floating_point<FloatingPointType>::value, "Error: exact_arithmetic<> invoked with unknown floating-point type"); |
82 | 86 |
|
83 | 87 | using float_type = FloatingPointType;
|
84 | 88 | using float_pair = std::pair<float_type, float_type>;
|
|
0 commit comments