mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Don't use GCC's __builtin_ffs
on riscv64 without Zbb extension
GCC redirects `__builtin_ffs` to `ffs` on RISC-V without the Zbb extension, causing a linker error.
This commit is contained in:
parent
d572ad38ac
commit
e300da4db4
Notes:
sideshowbarker
2024-07-16 23:54:15 +09:00
Author: https://github.com/spholz Commit: https://github.com/SerenityOS/serenity/commit/e300da4db4 Pull-request: https://github.com/SerenityOS/serenity/pull/20689 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 1 additions and 1 deletions
|
@ -134,7 +134,7 @@ inline constexpr int count_leading_zeroes_safe(IntType value)
|
|||
template<Integral IntType>
|
||||
inline constexpr int bit_scan_forward(IntType value)
|
||||
{
|
||||
#if defined(AK_COMPILER_CLANG) || defined(AK_COMPILER_GCC)
|
||||
#if defined(AK_COMPILER_CLANG) || (defined(AK_COMPILER_GCC) && (!ARCH(RISCV64) || defined(__riscv_zbb)))
|
||||
static_assert(sizeof(IntType) <= sizeof(unsigned long long));
|
||||
if constexpr (sizeof(IntType) <= sizeof(unsigned int))
|
||||
return __builtin_ffs(value);
|
||||
|
|
Loading…
Reference in a new issue