Skip to content

Commit faf121b

Browse files
committed
Add guard for old clangs
1 parent a38890d commit faf121b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

include/boost/safe_numbers/detail/signed_integer_basis.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,9 @@ BOOST_SAFE_NUMBERS_HOST_DEVICE constexpr auto signed_underflow_mul_msg() noexcep
14621462
return "Underflow detected in i128 multiplication";
14631463
}
14641464
}
1465+
#if BOOST_SAFE_NUMBERS_HAS_BUILTIN(__builtin_mul_overflow) && defined(BOOST_SAFE_NUMBERS_DETAIL_INT128_HAS_INT128) && (!defined(__clang__) || __clang_major__ >= 14)
1466+
# define BOOST_SAFE_NUMBERS_HAS_INT128_SIGNED_INTRIN_MUL
1467+
#endif
14651468

14661469
#if BOOST_SAFE_NUMBERS_HAS_BUILTIN(__builtin_mul_overflow)
14671470

@@ -1476,7 +1479,7 @@ auto signed_intrin_mul(const T lhs, const T rhs, T& result) -> signed_overflow_s
14761479
return signed_overflow_status::no_error;
14771480
}
14781481

1479-
#ifdef BOOST_SAFE_NUMBERS_DETAIL_INT128_HAS_INT128
1482+
#ifdef BOOST_SAFE_NUMBERS_HAS_INT128_SIGNED_INTRIN_MUL
14801483

14811484
inline auto signed_intrin_mul(const int128::int128_t lhs, const int128::int128_t rhs, int128::int128_t& result) -> signed_overflow_status
14821485
{
@@ -1492,7 +1495,7 @@ inline auto signed_intrin_mul(const int128::int128_t lhs, const int128::int128_t
14921495
return signed_overflow_status::no_error;
14931496
}
14941497

1495-
#endif // BOOST_SAFE_NUMBERS_DETAIL_INT128_HAS_INT128
1498+
#endif // BOOST_SAFE_NUMBERS_HAS_INT128_SIGNED_INTRIN_MUL
14961499

14971500
#elif defined(BOOST_SAFENUMBERS_HAS_WINDOWS_X64_INTRIN) || defined(BOOST_SAFENUMBERS_HAS_WINDOWS_X86_INTRIN)
14981501

0 commit comments

Comments
 (0)