Skip to content

Commit 2b95084

Browse files
committed
Fix issues where builtins not being detected
Signed-off-by: Ian <[email protected]>
1 parent 0061e6a commit 2b95084

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/ccmath/internal/math/generic/builtins/basic/fma.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
// ReSharper disable once CppUnusedIncludeDirective
1414
#include "ccmath/internal/math/generic/builtins/builtin_helpers.hpp"
15+
#include "ccmath/internal/predef/has_builtin.hpp"
1516
#include "ccmath/internal/support/always_false.hpp"
1617

1718
// Checks if the cpu supports FMA instructions.
@@ -51,7 +52,7 @@ namespace ccm::builtin
5152
*/
5253
template <typename T>
5354
inline constexpr bool has_fma =
54-
#if defined(__builtin_fma) || defined(__builtin_fmaf) || defined(__builtin_fmal)
55+
#if CCM_HAS_BUILTIN(__builtin_fma) || CCM_HAS_BUILTIN(__builtin_fmaf) || CCM_HAS_BUILTIN(__builtin_fmal)
5556
is_valid_builtin_type<T>;
5657
#else
5758
false;

include/ccmath/internal/support/bits.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ namespace ccm::support
309309
if (x < 2) { return 1; }
310310

311311
// Assume we got a good input
312-
const unsigned n = std::numeric_limits<T>::digits - countl_zero(static_cast<T>(x - 1U));
312+
const unsigned n = static_cast<unsigned>(std::numeric_limits<T>::digits - countl_zero(static_cast<T>(x - 1U)));
313313

314314
if constexpr (sizeof(T) >= sizeof(unsigned)) { return T{1} << n; }
315315
else

0 commit comments

Comments
 (0)